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
Filed under: visual basic | 1 Komentar »
program cek password
Posted on 30 Agustus 2010 by sttdb
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
OK kita mulai listing programmnya
Private Sub Command1_Click()screenshootnya
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
Filed under: visual basic | Tinggalkan sebuah Komentar »
UAS PEMROGRAMAN VISUAL BASIC
Posted on 22 Januari 2010 by sttdb
Codingnya
Private Sub Command1_Click()Soal no: 2
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
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
Filed under: visual basic | Tinggalkan sebuah Komentar »
membuat program gaji sederhana di vb
Posted on 8 Desember 2009 by qdank
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
Filed under: visual basic | 2 Komentar »
Kontrol pada visual basic
Posted on 22 April 2009 by sttdb
Penggunaan Dasar ComboBox
![formcombo formcombo](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_viIfceFJ0CvAlpl8wIreuuvYT7jDw1VDgd1hwl4xRhqiqlp0psczahhhZ9NVaOrEIgjbu5HBVyPsHyxOQQq4NwBms1DY0yfeIcQCHJIGN388hAx1sZrHGewpACWRIStw=s0-d)
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…)
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…)
Filed under: visual basic | Tinggalkan sebuah Komentar »
Mengatur Form ke tengah
Posted on 19 April 2009 by sttdb
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
Post a Comment