Pengumpan RSS

TUGAS VB 1

Posted on

MEY FITRIANINGSIH

11201104

VISUAL BASIC

 

 

PERKALIAN DUA BILANGAN

 

Private Sub cmdBersih_Click()

‘Mengosongkan isi TextBox

txtBil1.Text = “”

txtBil2.Text = “”

txtHasil.Text = “”

End Sub

 

Private Sub cmdHitung_Click()

‘Deklarasi Variabel Lokal

Dim a As Single

Dim b As Single

Dim Hasil As Single

 

Vara = txtBil1.Text

Varb = txtBil2.Text

Hasil = Vara * Varb

txtHasil.Text = Hasil

End Sub

 

Private Sub cmdKeluar_Click()

‘Mengakhiri Program

End

End Sub

 

 

 

 

 

 

 

 

 

PERHITUNGAN HARGSA SETELAH DISKON

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FONT COLOR & FONT STYLE

 

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

‘Membuat teks Miring

If chkItalic.Value = 1 Then

lblTeks.FontItalic = True

Else

lblTeks.FontItalic = False

End If

End Sub

 

Private Sub chkUnder_Click()

‘Membuat teks Garis Bawah

If chkUnder.Value = 1 Then

lblTeks.FontUnderline = True

Else

lblTeks.FontUnderline = False

End If

End Sub

 

Private Sub chkStrike_Click()

‘Membuat teks Coret

If chkStrike.Value = 1 Then

lblTeks.FontStrikeout = True

Else

lblTeks.FontStrikeout = False

End If

End Sub

 

 

Private Sub cmdExit_Click()

‘Mengakhiri Program

End

End Sub

Private Sub optRed_Click()

‘Membuat teks berwarna merah

lblTeks.ForeColor = vbRed

End Sub

 

Private Sub optGreen_Click()

‘Membuat teks berwarna hijau

lblTeks.ForeColor = vbGreen

End Sub

 

Private Sub optBlue_Click()

‘Membuat teks berwarna biru

lblTeks.ForeColor = vbBlue

End Sub

 

Private Sub optYellow_Click()

‘Membuat teks berwarna kuning

lblTeks.ForeColor = vbYellow

End Sub

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s

%d blogger menyukai ini: