Postingan

Menampilkan postingan dari Desember, 2018

tugas2.6

Gambar
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.FontStriket...

tugas2.5

Gambar
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

tugas2.4

Gambar
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

Gambar
PERHITUNGAN DENGAN KLIK HITUNG 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

Gambar
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

Gambar
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