oke to thepoin aja,,,
- pertama-tama jalankan apps Visual Basic 2010, kemudian pilih new project
\kemudian buat tampilan seperti ini, menggunakan label, textbox,button, radiobutton, dan checkbox, yang ada pada toolbox
kalo kurang jelas nii, saya lbih jelasnya..
Public Class Form1
Private Sub
Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.Text = "latihan
Q"
Label1.Text = "program percobaan
VB"
Label2.Text = "tulis dibawah"
Label3.Text = " "
Button1.Text = "prosesing"
radiobutton1.ForeColor = Color.Red
RadioButton2.ForeColor = Color.Blue
RadioButton3.ForeColor = Color.Green
CheckBox1.Text = "bold"
CheckBox2.Text = "underline"
CheckBox3.Text = "italic"
End Sub
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button1.Click
Label3.Text = TextBox1.Text
End Sub
Private Sub
radiobutton1_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
radiobutton1.CheckedChanged
Label3.ForeColor = Color.Red
End Sub
Private Sub
RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
RadioButton2.CheckedChanged
Label3.ForeColor = Color.Blue
End Sub
Private Sub
RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
RadioButton3.CheckedChanged
Label3.ForeColor = Color.Green
End Sub
Private Sub
CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
CheckBox1.CheckedChanged
If CheckBox1.Checked Then
Label3.Font = New Font(Label3.Font,
Label3.Font.Style Or FontStyle.Bold)
Else
Label3.Font = New Font(Label3.Font,
Label3.Font.Style And Not
FontStyle.Bold)
End If
End Sub
Private Sub
CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
CheckBox2.CheckedChanged
If CheckBox2.Checked Then
Label3.Font = New Font(Label3.Font,
Label3.Font.Style Or FontStyle.Underline)
Else
Label3.Font = New Font(Label3.Font,
Label3.Font.Style And Not
FontStyle.Underline)
End If
End Sub
Private Sub
CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
CheckBox3.CheckedChanged
If CheckBox3.Checked Then
Label3.Font = New Font(Label3.Font,
Label3.Font.Style Or FontStyle.Italic)
Else
Label3.Font = New Font(Label3.Font,
Label3.Font.Style And Not
FontStyle.Italic)
End If
End Sub
End Class
kemudian coba jalankan, klick run atau f5 dan hasilnya seperti ini,
itulah sedikit dari saya, selamat mencoba
good lock,,,,
Tidak ada komentar:
Posting Komentar