tugas vb 3

1.Gambar

Private Sub cmdHitung_Click()
Dim A, B, C As Double
TxtB.Text = Val(TxtA.Text) * 0.1
TxtC.Text = Val(TxtA.Text) – Val(TxtB.Text)
End Sub

Private Sub cmdQuit_Click()
End
End Sub

Private Sub cmdUlangi_Click()
TxtA = “”
TxtB = “”
TxtC = “”

End Sub

Private Sub Form_Load()

End Sub

 

2.

Gambar

Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String
Select Case Cbonpm.Text
Case “12201002”
nama = “HERLAMBANG”
jurusan = “Manajemen Informatika”
Case “09300024”
nama = “REMBOL SETIAWAN”
jurusan = “Sistem Informasi”
Case Is = “09400054”
nama = “MESUT OZIL”
jurusan = “Sistem Informasi”
End Select
Txtnama.Text = nama
Txtjurusan.Text = jurusan
Txtquis.SetFocus
End Sub

Private Sub Cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm.Text = “”
Txtnama.Text = “”
Txtjurusan.Text = “”
Txtquis.Text = “”
Txttugas.Text = “”
Txtuts.Text = “”
Txtuas.Text = “”
Txtna.Text = “”
Txthm.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(Txtquis.Text)
TUGAS = Val(Txttugas.Text)
UTS = Val(Txtuts.Text)
UAS = Val(Txtuas.Text)
NA = (QUIS + TUGAS + UTS + UAS) / 4
Txtna.Text = NA

Select Case Txtna.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
Txthm.Text = HM
End Sub

Private Sub Form_Load()
Cbonpm.AddItem “12201002”
Cbonpm.AddItem “09300024”
Cbonpm.AddItem “09400054”
End Sub

Private Sub Txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttugas.SetFocus
End If
End Sub

Private Sub Txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttuts.SetFocus
End If
End Sub

Private Sub Txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttuas.SetFocus
End If
End Sub

3.

Gambar

Private Sub cmdKeluar_Click()
End
End Sub

Private Sub cmdProses_Click()
Dim A, B, C, D, E, F As Double
txtD.Text = Val(txtA.Text) + Val(txtB.Text) – Val(txtC.Text)
txtE.Text = Val(txtD.Text) * (0.1)
txtF.Text = Val(txtD.Text) – Val(txtE.Text)
End Sub

Private Sub cmdUlang_Click()
txtA = “”
txtB = “”
txtC = “”
txtD = “”
txtE = “”
txtF = “”
End Sub

Private Sub Form_Load()

End Sub

 

4.

Gambar

Private Sub Command1_Click()
    Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

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

Private Sub command3_Click()
    Unload Me
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If Ascii = 13 Then
    Text2.SetFocus
    End If
End Sub

5.

Gambar

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

End Sub

Private Sub Command2_Click()
    Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Command3_Click()
    Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub Command4_Click()
    Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

Private Sub Command5_Click()
    Unload Me
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Text2.SetFocus
    End If
End Sub

6.

Gambar

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 Chkit_Click()

‘Membuat Teks Miring

If Chkit.Value = 1 Then

lblTeks.FontItalic = True

Else

lblTeks.FontItalic = False

End If

End Sub

 

Private Sub Chkst_Click()

‘Membuat Teks Strikeout

If ChkSst.Value = 1 Then

lblTeks.FontStrikethru = True

Else

lblTeks.FontStrikethru = False

End If

End Sub

 

Private Sub Chkun_Click()

‘Membuat Teks Underline

If Chkun.Value = 1 Then

lblTeks.FontUnderline = True

Else

lblTeks.FontUnderline = False

End If

End Sub

 

Private Sub Cmdexit_Click()

End

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 Berwarna Merah

lblTeks.ForeColor = vbRed

End Sub

 

Private Sub Optyellow_Click()

‘Membuat Teks Berwarna Kuning

lblTeks.ForeColor = vbYellow

End Sub

 

By herlambang startech pringsewu

Tinggalkan komentar