Skip to content

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

 

 

Private Sub Form_Load()
CboNPM.AddItem “12100661”
CboNPM.AddItem “12100662”
CboNPM.AddItem “12100663”
CboNPM.AddItem “12100664”
CboNPM.AddItem “12100665”
End Sub

Private Sub CboNPM_Click()
Dim Nama, Jurusan, HurufMutu As String
Select Case CboNPM.Text
Case “12100661”
Nama = “EKA ISTIANA DEWI”
Jurusan = “Sistem Informasi”
Case “12100662”
Nama = “ERIS PUTRI WAHYUNI”
Jurusan = “Manajemen Informatika”
Case “12100663”
Nama = “DEFIRA AYU WIDYA MUSTIKA”
Jurusan = “Teknisi Komputer”
Case “12100664”
Nama = “FESUS FERIYANTO”
Jurusan = “Operator Komputer”
Case “12100665”
Nama = “GAGA JERTA MAHENDRA”
Jurusan = “Programmer”
End Select
TxtQuis.SetFocus
TxtNama.Text = Nama
TxtJurusan.Text = Jurusan
TxtQuis.SetFocus
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
TxtUTS.SetFocus
End If
End Sub

Private Sub TxtUTS_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtUAS.SetFocus
End If
End Sub

Private Sub TxtUAS_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNA.SetFocus
Dim NA As Integer
Dim HurufMutu 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
HurufMutu = “A”
Case Is > 70
HurufMutu = “B”
Case Is > 60
HurufMutu = “C”
Case Is > 50
HurufMutu = “D”
Case Is < 50
HurufMutu = “E”
End Select
TxtHurufMutu.Text = HurufMutu
End If
End Sub

Private Sub CmdProses_Click()
Dim NA As Integer
Dim HurufMutu 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
HurufMutu = “A”
Case Is > 70
HurufMutu = “B”
Case Is > 60
HurufMutu = “C”
Case Is > 50
HurufMutu = “D”
Case Is < 50
HurufMutu = “E”
End Select
TxtHurufMutu.Text = HurufMutu
End Sub

Private Sub CmdBatal_Click()
CboNPM.SetFocus
CboNPM = “”
TxtNama = “”
TxtJurusan = “”
TxtQuis = “”
TXtTugas = “”
TxtUTS = “”
TxtUAS = “”
TxtNA = “”
TxtHurufMutu = “”
End Sub

Private Sub CmdKeluar_Click()
End
End Sub

Advertisements

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

Private Sub OptRed_Click()
LblTeks.ForeColor = vbRed
End Sub

Private Sub OptGreen_Click()
LblTeks.ForeColor = vbGreen
End Sub

Private Sub OptBlue_Click()
LblTeks.ForeColor = vbBlue
End Sub

Private Sub OptWhite_Click()
LblTeks.ForeColor = vbWhite
End Sub

Private Sub ChkBold_Click()
If ChkBold.Value = 1 Then
LblTeks.FontBold = True
Else
LblTeks.FontBold = False
End If
End Sub

Private Sub ChkItalic_Click()
If ChkItalic.Value = 1 Then
LblTeks.FontItalic = True
Else
LblTeks.FontItalic = False
End If
End Sub

Private Sub ChkUnderline_Click()
If ChkUnderline.Value = 1 Then
LblTeks.FontUnderline = True
Else
LblTeks.FontUnderline = False
End If
End Sub

Private Sub ChkStrikethru_Click()
If ChkStrikethru.Value = 1 Then
LblTeks.FontStrikethru = True
Else
LblTeks.FontStrikethru = False
End If
End Sub

Private Sub CmdDelete_Click()
LblTeks.ForeColor = vbBlack
OptRed = False
OptGreen = False
OptBlue = False
oprwhite = False
ChkBold = False
ChkItalic = False
ChkUnderline = False
ChkStrikethru = False
End Sub

Private Sub CmdExit_Click()
End
End Sub

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

Private Sub Txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt2.SetFocus
End If
End Sub

Private Sub Txt2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt3.SetFocus
End If
End Sub

Private Sub Txt3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt4.SetFocus
Txt4.Text = Val(Txt1.Text) + Val(Txt2.Text) – Val(Txt3.Text)
Txt5.Text = Val(Txt4.Text) * 0.1
Txt6.Text = Val(Txt4.Text) – Val(Txt5.Text)
End If
End Sub

Private Sub CmdProses_Click()
Txt4.Text = Val(Txt1.Text) + Val(Txt2.Text) – Val(Txt3.Text)
Txt5.Text = Val(Txt4.Text) * 0.1
Txt6.Text = Val(Txt4.Text) – Val(Txt5.Text)
End Sub

Private Sub CmdHapus_Click()
Txt1.SetFocus
Txt1 = “”
Txt2 = “”
Txt3 = “”
Txt4 = “”
Txt5 = “”
Txt6 = “”
End Sub

Private Sub Cmd3_Click()
End
End Sub

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

 

 

 

Private Sub Txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt2.SetFocus
Txt2.Text = Val(Txt1.Text) * 0.1
End If
End Sub

Private Sub Txt2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt3.SetFocus
Txt3.Text = Val(Txt1.Text) – Val(Txt2.Text)
End If
End Sub

Private Sub CmdHitung_Click()
Txt2.Text = Val(Txt1.Text) * 0.1
Txt3.Text = Val(Txt1.Text) – Val(Txt2.Text)
End Sub

Private Sub CmdUlangi_Click()
Txt1.SetFocus
Txt1 = “”
Txt2 = “”
Txt3 = “”
End Sub

Private Sub CmdQuit_Click()
End
End Sub

Tugas visual basic

Capture

 

 

 

 

 

 

 

Private Sub Txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt2.SetFocus
End If
End Sub

Private Sub OptTambah_Click()
Txt3.Text = Val(Txt1.Text) + Val(Txt2.Text)
End Sub

Private Sub OptKurang_Click()
Txt3.Text = Val(Txt1.Text) – Val(Txt2.Text)
End Sub

Private Sub OptKali_Click()
Txt3.Text = Val(Txt1.Text) * Val(Txt2.Text)
End Sub

Private Sub OptBagi_Click()
Txt3.Text = Val(Txt1.Text) / Val(Txt2.Text)
End Sub

Private Sub OptBagiBilangan_Click()
Txt3.Text = Val(Txt1.Text) \ Val(Txt2.Text)
End Sub

Private Sub OptPangkat_Click()
Txt3.Text = Val(Txt1.Text) ^ Val(Txt2.Text)
End Sub

Private Sub Optand_Click()
Txt3.Text = Val(Txt1.Text) & Val(Txt2.Text)
End Sub

Private Sub OptModulus_Click()
Txt3.Text = Val(Txt1.Text) Mod Val(Txt2.Text)
End Sub

Private Sub CmdDelete_Click()
Txt1.SetFocus
Txt1 = “”
Txt2 = “”
Txt3 = “”
OptTambah = False
OptKurang = False
OptKali = False
OptBagi = False
OptBagiBilangan = False
OptPangkat = False
Optand = False
OptModulus = False
End Sub

Private Sub CmdExit_Click()
End
End Sub

 

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) / Val(Text2.Text)
Text6.Text = Val(Text1.Text) – Val(Text2.Text)
End If
End Sub

Private Sub CmdHitung_Click(Index As Integer)
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) / Val(Text2.Text)
Text6.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub

Private Sub CmdHapus_Click(Index As Integer)
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”
End Sub

Private Sub CmdKeluar_Click(Index As Integer)
End
End Sub

Tugas visual basic

Capture

 

 

 

 

 

 

 

 

KODE PROGRAM :

Private Sub Txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt2.SetFocus
End If
End Sub

Private Sub Txt2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt3.SetFocus
End If
End Sub

Private Sub Txt3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt4.SetFocus
Txt4.Text = Val(Txt1.Text) * Val(Txt2.Text) / Val(Txt3.Text)
End If
End Sub

Private Sub CmdHitung_Click()
Txt4.Text = Val(Txt1.Text) * Val(Txt2.Text) / Val(Txt3.Text)
End Sub

Private Sub CmdBersih_Click()
Txt1.SetFocus
Txt1 = “”
Txt2 = “”
Txt3 = “”
Txt4 = “”
End Sub

Private Sub CmdKeluar_Click()
End
End Sub