Menghitung luas kubus,persegi panjang dan lingkaran



listing programmnya :
Private Sub Command1_Click()
Text4.Text = 6 * Val(Text2.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) * Val(Text2.Text)
Text6.Text = 3.14 * Val(Text3.Text) * Val(Text3.Text)
End Sub
Private Sub Command2_Click()
Unload Me
End Sub

program cek password

buat program cek password ,jika password sama makan akan keluar,jika tidak maka akan ada pesan kesalahan(gunakan show mesage) inputanya adalah nama,password ,confirm password.
OK kita mulai listing programmnya
Private Sub Command1_Click()
Dim intKeluar As Integer
Do While (True)
If (Text1.Text = “admin” And Text2.Text = “sttdb”) Then
intpesan = MsgBox(“Password Anda Benar!”, , “informasi”)
Unload Form1 ‘akan mengeluakan anda dari form1
End
Else
intpesan = MsgBox(“password Anda Salah!Ulangi!”, , “informasi”)
Text1.Text = “” ‘bila mengulangi mengisi  form,teks akan dikosongkan lagi
Text2.Text = “”
Text2.SetFocus
Exit Do
End If
Loop
End Sub
Private Sub Command2_Click()
End
End Sub
screenshootnya
jika password benar
Jika password salah

UAS PEMROGRAMAN VISUAL BASIC


Codingnya
Private Sub Command1_Click()
Dim NA As Integer
UTS = Text1.Text
UAS = Text2.Text
ket = Text4.Text
NA = Val(0.4 * UTS) + Val(0.6 * UAS)
Text3.Text = NA
If NA >= 80 Then
Text4.Text = “baik”
Else
If NA >= 66 Then
Text4.Text = “CuKuP”
Else
If NA < 66 Then
Text4.Text = “Kurang”
End If
End If
End If
End Su
Soal no: 2

listing coding
Private Sub Option1_Click()
Text1.Text = “SISTEM BASIS DATA”
Text2.Text = “4″
Text3.Text = “Keahlian”
End Sub
Private Sub Option2_Click()
Text1.Text = “SIM”
Text2.Text = “4″
Text3.Text = “Keahlian”
End Sub
Private Sub Option3_Click()
Text1.Text = “KALKULUS”
Text2.Text = “3″
Text3.Text = “Umum”
End Sub

membuat program gaji sederhana di vb


listing programnya
Private Sub Command1_Click()
If Text2.Text = “A” Then
Text4.Text = 1000
Text5.Text = 500
If Text3.Text > 40 Then
Text6.Text = (Text3.Text – 40) * 500
Text7.Text = Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)
Else
Text6.Text = “TIDAK ADA LEMBURAN”
Text7.Text = Val(Text4.Text) + Val(Text5.Text)
End If
Else
If Text2.Text = “B” Then
Text4.Text = 1500
Text5.Text = 800
If Text3.Text > 40 Then
Text6.Text = (Text3.Text – 40) * 500
Text7.Text = Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)
Else
Text6.Text = “TIDAK ADA LEMBURAN”
Text7.Text = Val(Text4.Text) + Val(Text5.Text)
End If
Else
If Text2.Text = “C” Then
Text4.Text = 2000
Text5.Text = 1000
If Text3.Text > 40 Then
Text6.Text = (Text3.Text – 40) * 500
Text7.Text = Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)
Else
Text6.Text = “TIDAK ADA LEMBURAN”
Text7.Text = Val(Text4.Text) + Val(Text5.Text)
End If
End If
End If
End If
Text1.SetFocus
End Sub
Private Sub Command2_Click()
If MsgBox(“Anda Yakin Keluar”, vbOKCancel + vbDefaultButton2, “Tutup Aplikasi”) = vbOK Then
End
End If
End Sub

Kontrol pada visual basic

Penggunaan Dasar ComboBox
formcombo

Private Sub Form_Load()
Do While adoRset.EOF = False
Combo1.AddItem
adoRset!customerid
adoRset.MoveNext Loop
End Sub
Perhatikan adoRset!customerid, berati si combobox akan menampilkan semua record customerid ke dalam ComboBox
(more…)

Mengatur Form ke tengah



Secara default, ketika kita mencoba membuat form di Visual Basic 6 dan menjalankannya, maka form itu akan terbuka secara sembarangan, biasanya di sebelah kiri pojok atas. Jika kita membuat aplikasi dengan profesional looking, tentu hal ini tidak bagus. Kita harus mengaturnya dengan letak yang baik, tepat di tengah layar misalnya. Nah di artikel ini saya akan berbagai satu function yang akan membuat form kita terbuka tepat di tengah layar. Function ini sangat sederhana, kita akan menggerakan form ini ke koordinat tengah layar.

Comments

Popular posts from this blog

"DAFTAR ALAMAT EMAIL PERUSAHAAN"

Program menghitung resistor dengan bahasa c