Huruf Mutu

vb HM

Private Sub Combo1_Click()
Dim nama, jurusan, HM As String
Select Case Combo1.Text
Case “09100027”
nama = “DESI TRI PUJI ASTUTI”
jurusan = “Sistem Informasi”
Case “09200048”
nama = “ARMAN MAULANA”
jurusan = “Manajemen Informatika”
Case “09300024”
nama = “BAGUS SUCAHYO”
jurusan = “Tehnik Informatika”
End Select
Text2.Text = nama
Text3.Text = jurusan
Text4.SetFocus

End Sub

Private Sub Command1_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(Text4.Text)
TUGAS = Val(Text5.Text)
UTS = Val(Text6.Text)
UAS = Val(Text7.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
Text8.Text = NA

Select Case Text8.Text
Case Is > 80
HM = “A”
Case Is > 70
HM = “B”
Case Is > 60
HM = “C”
Case Is > 50
HM = “D”
Case Is < 50
HM = “E”
End Select
Text1.Text = HM

End Sub

Private Sub Command2_Click()
Combo1.SetFocus
Combo1.Text = “”
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
Text7.Text = “”
Text8.Text = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Combo1.AddItem “09100027”
Combo1.AddItem “09200048”
Combo1.AddItem “09300024”

End Sub

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

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text8.SetFocus
End If
End Sub

Advertisements

Perkalian

form1

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

Microsoft VB

vb mb

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

Tugas VB (Penghitungan Gaji)

perhitungan

Private Sub Command1_Click()
Dim A, B, C, D, E, F As Double
Text4.Text = Val(Text1.Text) + Val(Text2.Text) – Val(Text3.Text)
Text5.Text = Val(Text4.Text) * (0.1)
Text6.Text = Val(Text4.Text) – Val(Text5.Text)
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.SetFocus
End If
End Sub

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

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub

Private Sub Ulang_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text5.Text = “”
Text6.Text = “”
End Sub