Minggu, 02 Desember 2018

tugas 2.6



Private Sub Check1_Click()
Label2.FontBold = Check1.Value

End Sub

Private Sub Check2_Click()
Label2.FontItalic = Check2.Value

End Sub

Private Sub cmdselesai_Click()
End

End Sub

Private Sub ketik_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Label2 = ketik.Text
End If

End Sub

Private Sub ok_Click()
Label2.Caption = ketik.Text

End Sub

Private Sub Option1_Click()
Label2.ForeColor = vbBlue

End Sub

Private Sub Option2_Click()
Label2.ForeColor = vbRed

End Sub

tugas 2.5




Private Sub Biru_Click()
Label1.ForeColor = vbBlue
End Sub

Private Sub Command1_Click()
End
End Sub

Private Sub Coret_Click()
'membuat teks coret
If Coret.Value = 1 Then
Label1.FontStrikethru = True
Else
Label1.FontStrikethru = False
End If
End Sub

Private Sub Garisbawah_Click()
'membuat garis bawah
If Garisbawah.Value = 1 Then
Label1.FontUnderline = True
Else
Label.FontUnderline = False
End If
End Sub

Private Sub Kuning_Click()
Label1.ForeColor = vbYellow
End Sub

Private Sub Merah_Click()
Label1.ForeColor = vbRed
End Sub

Private Sub Hijau_Click()
Label1.ForeColor = vbGreen
End Sub

Private Sub Miring_Click()
'membuat teks miring
If Miring.Value = 1 Then
Label1.FontItalic = True
Else
Label1.FontItalic = False
End If

End Sub

Private Sub Tebal_Click()
'membuat teks tebal
If Tebal.Value = 1 Then
Label1.FontBold = True
Else
Label1.FontBold = False
End If
End Sub
 

Tugas 2.4




Private Sub Command1_Click()
Text4 = Val(Text1) + Val(Text2) - Val(Text3)
Text5 = Val(Text4) * 0.1
Text6 = Val(Text4) - Val(Text5)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Text3_KEYPRESS(KEYASCII As Integer)
If KEYASCII = 13 Then
Text4 = Val(Text1) + Val(Text2) - Val(Text3)
Text5 = Val(Text4) * 0.1
Text6 = Val(Text4) - Val(Text5)
End If
End Sub