Minggu, 02 Desember 2018
Tugas2.6
Private Sub Biru_Click()
'membuat teks berwarna Biru
Hasil.ForeColor = vbBlue
End Sub
Private Sub Hijau_Click()
'membuat teks berwarna Hijau
Hasil.ForeColor = vbGreen
End Sub
Private Sub Kuning_Click()
'membuat teks berwarna Kuning
Hasil.ForeColor = vbYellow
End Sub
Private Sub Merah_Click()
'membuat teks berwarna merah
Hasil.ForeColor = vbRed
End Sub
Private Sub Tebal_Click()
'membuat teks tebal
If Tebal.Value = 1 Then
Hasil.FontBold = True
Else
Hasil.FontBold = False
End If
End Sub
Private Sub Miring_Click()
'membuat teks miring
If Miring.Value = 1 Then
Hasil.FontItalic = True
Else
Hasil.FontItalic = False
End If
End Sub
Private Sub GarisBawah_Click()
'membuat teks GarisBawah
If GarisBawah.Value = 1 Then
Hasil.FontUnderline = True
Else
Hasil.FontUnderline = False
End If
End Sub
Private Sub Coret_Click()
'membuat teks coret
If Coret.Value = 1 Then
Hasil.FontStrikethru = True
Else
Hasil.FontStrikethru = False
End If
End Sub
Private Sub Keluar_Click()
End
End Sub
Tugas2.5
Private Sub Ketik_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Label2 = Ketik.Text
End If
End Sub
Private Sub OK_Click()
Label2.Caption = Ketik.Text
End Sub
Private Sub Option1_Click()
Label2.ForeColor = vbBlue
End Sub
Private Sub Option2_Click()
Label2.ForeColor = vbRed
End Sub
Private Sub Check1_Click()
Label2.FontBold = Check1.Value
End Sub
Private Sub Check2_Click()
Label2.FontItalic = Check2.Value
End Sub
Private Sub Selesai_Click()
End
End Sub
Sabtu, 01 Desember 2018
tugas2.4
PERHITUNGAN DENGAN MENEKAN TOMBOL ENTER
Private Sub Command1_Click()
Text4 = Val(Text1) + Val(Text2) - Val(Text3)
Text5 = Val(Text4) * 0.1
Text6 = Val(Text4) - Val(Text5)
End Sub
Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
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 = Val(Text1) + Val(Text2) - Val(Text3)
Text5 = Val(Text4) * 0.1
Text6 = Val(Text4) - Val(Text5)
End If
End Sub
tugas2.3
PERHITUNGAN DENGAN KLIK PROSES
Private Sub Command1_Click()
Text4 = Val(Text1) + Val(Text2) - Val(Text3)
Text5 = Val(Text4) * 0.1
Text6 = Val(Text4) - Val(Text5)
End Sub
Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
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
tugas2.2
PERHITUNGAN DENGAN MENEKAN TOMBOL ENTER
Private Sub Command1_Click()
Text2 = Val(Text1) * 0.1
Text3 = Val(Text1) - Val(Text2)
End Sub
Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2 = Val(Text1) * 0.1
Text3 = Val(Text1) - Val(Text2)
End If
End Sub
tugas2.1
PERHITUNGAN DENGAN KLIK HITUNG
Private Sub Command1_Click()
Text2 = Val(Text1) * 0.1
Text3 = Val(Text1) - Val(Text2)
End Sub
Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Private Sub Command3_Click()
End
End Sub
Minggu, 25 November 2018
tugas 1.5
Private Sub Command1_Click()
Text3 = Val(Text1) + Val(Text2)
Text6 = Val(Text4) * Val(Text5)
Text9 = Val(Text7) - Val(Text8)
Text12 = Val(Text10) / Val(Text11)
End Sub
Private Sub Command2_Click()
Text1.SetFocus
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
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 Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text8.SetFocus
End If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text11.SetFocus
End If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3 = Val(Text1) + Val(Text2)
Text6 = Val(Text4) * Val(Text5)
Text9 = Val(Text7) - Val(Text8)
Text12 = Val(Text10) / Val(Text11)
end if
End Sub
Langganan:
Postingan (Atom)

