TUGAS 1.1
1.1

Private Sub cmdhitung_Click()
Txtdis.Text = Val(txtha) * 0.1
txthak.Text = Val(txtha) – Val(Txtdis)
End Sub
Private Sub cmdquit_Click()
End
End Sub
Private Sub cmdulangi_Click()
txtha.SetFocus
txtha.Text = “”
Txtdis.Text = “”
txthak.Text = “”
End Sub

1.2
1.1

Private Sub cmdhitung_Click()
Txtdis.Text = Val(txtha) * 0.1
txthak.Text = Val(txtha) – Val(Txtdis)
End Sub
Private Sub cmdquit_Click()
End
End Sub
Private Sub cmdulangi_Click()
txtha.SetFocus
txtha.Text = “”
Txtdis.Text = “”
txthak.Text = “”
End Sub
Private Sub txtha_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtdis.Text = Val(txtha) * 0.1
txthak.Text = Val(txtha) – Val(Txtdis)
End If
End Sub

TUGAS 3.1

2.1

Private Sub Cmdproses_Click()
txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)
txtpjk.Text = Val(txtgk) * 0.1
txtgd.Text = Val(txtgk) – Val(txtpjk)
End Sub

Private Sub cmdulangi_Click()
txtgp.SetFocus
txtgp = “”
txttun = “”
txtpot = “”
txtgk = “”
txtpjk = “”
txtgd = “”
End Sub
Private Sub txtgp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttun.SetFocus
End If
End Sub

Private Sub txttun_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpot.SetFocus
End If
End Sub
Private Sub cmdkeluar_Click()
End
End Sub

3.2

2.1

Private Sub Cmdproses_Click()
txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)
txtpjk.Text = Val(txtgk) * 0.1
txtgd.Text = Val(txtgk) – Val(txtpjk)
End Sub

Private Sub cmdulangi_Click()
txtgp.SetFocus
txtgp = “”
txttun = “”
txtpot = “”
txtgk = “”
txtpjk = “”
txtgd = “”
End Sub

Private Sub txtgp_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttun.SetFocus
End If
End Sub

Private Sub txtpot_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)
txtpjk.Text = Val(txtgk) * 0.1
txtgd.Text = Val(txtgk) – Val(txtpjk)
End If
End Sub
Private Sub txttun_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpot.SetFocus
End If
End Sub
Private Sub cmdkeluar_Click()
End
End Sub

tugas 5

3
Private Sub Chkbold_Click()
‘membuat teks tebal
If Chkbold.Value = 1 Then
lbltext.FontBold = True
Else
lbltext.FontBold = False
End If
End Sub

Private Sub chhitalic_click()
‘membuat teks miring
If Chhitalic.Value = 1 Then
lbltext.FontItalic = True
Else
lbltext.FontItalic = False
End If
End Sub

Private Sub Chkstrikeout_Click()
‘membuat teks bergaris tengah
If Chkstrikeout.Value = 1 Then
lbltext.Fontstrikeout = True
Else
lbltext.Fontstrikeout = False
End If
End Sub

Private Sub Chkunderline_Click()
‘membuat teks bergaris bawah
If Chkunderline.Value = 1 Then
lbltext.FontUnderline = True
Else
lbltext.FontUnderline = False
End If
End Sub

Private Sub Optblue_Click()
‘membuat teks biru
lbltext.ForeColor = vbBlue
End Sub
Private Sub Optgreed_Click()
‘membuat teks hijau
lbltext.ForeColor = vbGreen
End Sub

Private Sub OptRED_Click()
‘membuat teks merah
lbltext.ForeColor = vbRed
End Sub

Private Sub optyellow_Click()
‘membuat teks kuning
lbltext.ForeColor = vbYellow
End Sub

tugas 6

6

Private Sub chkitalic_Click()
‘membuat teks miring
If chkitalic.Value = 1 Then
lbltext.FontItalic = True
Else
lbltext.FontItalic = False
End If
End Sub

Private Sub cmdok_Click()
lbltext.Text = Val(Text1.Text)
End Sub

Private Sub cmdselesai_Click()
End
End Sub

Private Sub optblue_Click()
‘membuat teks berwarna biru
lbltext.ForeColor = vbBlue
End Sub

Private Sub chkbold_Click()
‘membuat teks tebal
If chkbold.Value = 1 Then
lbltext.FontBold = True
Else
lbltext.FontBold = False
End If
End Sub

Private Sub optred_Click()
‘membuat teks berwarna merah
lbltext.ForeColor = vbRed
End Sub

Private Sub lbltext_Change()
lbltext.Text = Text1.Text
End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s