TUGAS Mr.visual basic

Untitled-1

 

Private Sub Check1_Click()
‘Membuat teks Tebal
If Check1.Value = 1 Then
Label1.FontBold = True
Else
Label1.FontBold = False
End If
End Sub

Private Sub Check2_Click()
‘Membuat teks miring
If Check2.Value = 1 Then
Label1.FontItalic = True
Else
Label1.FontItalic = False
End If
End Sub

Private Sub Check3_Click()
‘Membuat teks bergaris
If Check3.Value = 1 Then
Label1.FontUnderline = True
Else
Label1.FontUnderline = False
End If
End Sub

Private Sub Check4_Click()
‘Membuat teks bergaris
If Check4.Value = 1 Then
Label1.FontStrikethru = True
Else
Label1.FontStrikethru = False
End If
End Sub

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Option2_Click()
‘Membuat teks bewarna hijau
Label1.ForeColor = vbGreen
End Sub

Private Sub Option1_Click()
‘Membuat teks bewarna merah
Label1.ForeColor = vbRed
End Sub

Private Sub Option3_Click()
‘Membuat teks bewarna biru
Label1.ForeColor = vbBlue
End Sub

Private Sub Option4_Click()
‘Membuat teks bewarna kuning
Label1.ForeColor = vbYellow
End Sub

Advertisements

tugas perkalian

Untitled

Private Sub command1_click()
Text4.Text = Val(Text2.Text) * Val(Text3.Text)
End Sub

Private Sub command2_click()
txt1 = SetFocus
txt1 = “”
txt2 = “”
txt3 = “”
End Sub

Private Sub command3_click()
Unload Me
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub

TUGAS VB 2

vb

Private Sub Command1_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
End Sub

Private Sub Command3_Click()
Unload Me
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.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
Text5.Text = Val(Text3.Text) * Val(Text4.Text)
End If
End Sub

TUGAS VB1

MULYANI

Private Sub Command1_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
End Sub

Private Sub Command3_Click()
Unload Me
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.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub