Coding Project Visual Basic 6.0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Menghitung Luas Segitiga

CODING TOMBOL HITUNG

Private Sub cmdhitung_Click()


txtluas.Text = Val(txtalas.Text) * (txttinggi.Text) / 2
End Sub

CODING TOMBOL BERSIH tombol keluar

Private Sub cmdberish_Click() Dim Pesan As String


txtalas.Text = Clear Pesan = "Anda Ingin Exit ?"
txttinggi.Text = Clear x = MsgBox(Pesan, vbYesNo, "Konfirmasi")
txtluas.Text = Clear If x = vbYes Then End
END SUB

End Sub

Volume tabung

Coding tombol proses


Private Sub Command1_Click()
Const pi As Double = 3.14
Dim r, t, vol As Double
r = Val(Text1.Text)
t = Val(Text2.Text)
vol = pi * (r * r) * t
Text3.Text = vol
End Sub

Coding tombol hapus/Bersih/Clear


Coding Tombol keluar /Exit Private Sub Command2_Click()
Dim Pesan As String Text1.Text = " "
Pesan = "Anda Ingin Exit ?" Text2.Text = " "
x = MsgBox(Pesan, vbYesNo, "Konfirmasi") Text3.Text = " "
If x = vbYes Then End End Sub
Coding memberikan warna, menebalkan dan
Aplikasi Menginputkan nama memiringkan tulisan:

Private Sub Check1_Click()


Label2.FontItalic = Check1.Value
End Sub

Private Sub Check2_Click()


Label2.FontBold = Check2.Value
End Sub

Private Sub Option1_Click()


Label2.ForeColor = vbRed
End Sub

Private Sub Option2_Click()


Coding Tombol Keluar Label2.ForeColor = vbBlue
End Sub
Private Sub Command2_Click()
a = MsgBox("Apakah Anda Yakin Ingin Keluar?",
Coding tombol proses
vbYesNo + vbInformation, "Konfirmasi")
If a = vbYes Then End
Private Sub Command1_Click()
End Sub
Label2.Caption = Text1.Text
End Sub

Kalkulator Sederhana

Coding tombol +
Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + (Text2.Text)
End Sub

Coding tombol -
Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) - (Text2.Text)
End Sub

Coding tombol *
Coding Tombol Keluar Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) * (Text2.Text)
Private Sub Command2_Click() End Sub
a = MsgBox("Apakah Anda Yakin Ingin Keluar?",
vbYesNo + vbInformation, "Konfirmasi") Coding tombol /
If a = vbYes Then End Private Sub Command4_Click()
End Sub Text3.Text = Val(Text1.Text) / (Text2.Text)
End Sub
Coding tombol hapus/Bersih/Clear
Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
End Sub
Menghitung Volume Kubus

Coding tombol Hitung/Proses:

Private Sub Command1_Click()


Text2.Text = Val(Text1.Text) ^ 3
End Sub

Coding tombol hapus/Bersih/Clear


Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
End Sub

Coding Tombol Keluar

Private Sub Command2_Click()


a = MsgBox("Apakah Anda Yakin Ingin Keluar?",
vbYesNo + vbInformation, "Konfirmasi")
If a = vbYes Then End
End Sub

Tombol Login

Coding tombol login :


Private Sub Command1_Click()
If Text2.Text = "1234" Then
MsgBox " Selamat Datang! ", vbInformation
End If
End Sub

You might also like