TUGAS VB

Private Sub chkItalic_Click()
‘Membuat teks Miring
If chkItalic.Value = 1 Then
lblteks.FontItalic = True
Else
lblteks.FontItalic = False
End If
End Sub

Private Sub chkStrike_Click()
‘Membuat teks Garis Tengah
If chkStrike.Value = 1 Then
lblteks.FontStrikethru = True
Else
lblteks.FontStrikethru = False
End If
End Sub

Private Sub chkUnder_Click()
‘Membuat teks Garis Bawah
If chkUnder.Value = 1 Then
lblteks.FontUnderline = True
Else
lblteks.FontUnderline = False
End If
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub optBlue_Click()
‘membuat teks berwarna biru
lblteks.ForeColor = vbBlue
End Sub

Private Sub optGreen_Click()
‘membuat teks berwarna hijau
lblteks.ForeColor = vbGreen
End Sub

Private Sub optRed_Click()
‘Membuat teks bewarna merah
lblteks.ForeColor = vbRed
End Sub
Private Sub chkBold_Click()
‘Membuat teks Tebal
If chkBold.Value = 1 Then
lblteks.FontBold = True
Else
lblteks.FontBold = False
End If
End Sub

Private Sub optYellow_Click()
‘membuat teks berwarna kuning
lblteks.ForeColor = vbYellow
End Sub


Private Sub Timer1_Timer()
Lbljam.Caption = Format(Now, “hh:mm:ss”)
End Sub

 


Private Sub cmdBersih_Click()
‘Mengosongkan isi TextBox
Txtbil1.Text = “”
Txtbil2.Text = “”
Txthasil.Text = “”
End Sub
Private Sub cmdHitung_Click()
‘Deklarasi Variabel Lokal
Dim a As Single
Dim b As Single
Dim Hasil As Single
a = Txtbil1.Text
b = Txtbil2.Text
Hasil = a * b
Txthasil.Text = Hasil
End Sub
Private Sub cmdKeluar_Click()
‘Mengakhiri Program
End
End Sub

 

Leave a comment