1. Seperti biasa buka VB.NET lalu buat project baru
2. Lalu masukkan beberapa component ke dalam Form1[Design]
-2 Label
*Label1 : Contoh Text :
*Label2 <- Dibagian proerpty ubah Visible menjadi False
-1 Button : Submit
-4 Radio Button
*RadioButton1 : Merah
*RadioButton2 : Kuning
*RadioButton3 : Tebal
*RadioButton4 : Miring
-1 Panel
3. Setelah itu beri codingan Form1[Design] dengan coding seperti berikut
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label2.Text = TextBox1.Text
Label2.Visible = True
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
Label2.ForeColor = Color.Red
ElseIf RadioButton1.Checked = False Then
Label2.ForeColor = Color.Black
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
Label2.ForeColor = Color.Yellow
ElseIf RadioButton2.Checked = False Then
Label2.ForeColor = Color.Black
End If
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
If RadioButton4.Checked = True Then
Label2.Font = New Font("Microsoft Sans Serif", 20.25, FontStyle.Bold)
ElseIf RadioButton4.Checked = False Then
Label2.Font = New Font("Microsoft Sans Serif", 20.25, FontStyle.Regular)
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked = True Then
Label2.Font = New Font("Microsoft Sans Serif", 20.25, FontStyle.Italic)
ElseIf RadioButton3.Checked = False Then
Label2.Font = New Font("Microsoft Sans Serif", 20.25, FontStyle.Regular)
End If
End Sub
End Class
4. Setelah itu coba jalankan
Download Project : Disini
Kamis, 09 Februari 2017
Label : VB.NET
Cara Membuat Aplikasi Style Teks(Teks miring,teks tebal,merubah warna) VB.NET
By
Deri Kokara
Dated
19.09
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar