Dari merubah font menjadi bold , underline , italic lalu merubah font color dan sizenya dll.
- Buatlah rancangan form dengan menggunakan Windows Forms seperti gambar dibawah ini :
Rancangan form ini terdiri dari 1 Form , 10 Button , dan 1 buah label dengan properties sebagai berikut :
Setelah membuat rancangan diatas silahkan PAHAMI CODE berikut , lalu masukan dan coba :1. Form1
- Name = Form1
2. Label1
- Text = Form1
- Name = label1
- Font = Microsoft Sans Serif Size = 14, FontStyle : Reguler
- Text = AWAL BELAJAR VB.NET
- Border Style = FixedSingle
3. Button1
- AutoSize = False
- Name = button1
- Text = B
4. Button2
- Font = Microsoft Sans Serif Size = 8 , FontStyle : Bold
- Name = button2
- Text = U
5. Button3
- Font = Microsoft Sans Serif Size = 8 , FontStyle : Underline
- Name = button3
- Text = I
6. Button4
- Font = Microsoft Sans Serif Size = 8 , FontStyle : Italic
- Name = button4
7. Button5
- Text = FONT COLOR
- Name = button5
8. Button6
- Text = FONT SIZE
- Name = button6
9. Button7
- Text = TOP CENTER
- Name = button7
10. Button8
- Text = BOTTOM CENTER
- Name = button8
11. Button9
- Text = TEXT FORM
- Name = button9
12. Button10
- Text = NORMAL
- Name = button10
- Text = Exit
Berikut Tutorial Pembuatannya :Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Font = New System.Drawing.Font(Label1.Font(), FontStyle.Bold)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Label1.Font = New System.Drawing.Font(Label1.Font(), FontStyle.Underline)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Label1.Font = New System.Drawing.Font(Label1.Font(), FontStyle.Italic)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Label1.ForeColor = Color.Blue
'Label1.ForeColor = System.Drawing.Color.Blue
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Label1.Font = New System.Drawing.Font("Arial", 20)
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Label1.TextAlign = ContentAlignment.TopCenter
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Label1.TextAlign = ContentAlignment.BottomCenter
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Form1.ActiveForm.Text = "Visual VB.net"
End Sub
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14, FontStyle.Regular)
Label1.TextAlign = ContentAlignment.MiddleCenter
Label1.ForeColor = System.Drawing.Color.Black
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
Me.Dispose()
End
End Sub
End Class
Semoga membantu :) untuk pertanyaan bisa langsung ditanyakan dikolom komentar , terimakasih.
Berkomentar lah dengan bijak , bila ada konten ada kesalahan dalam konten mohon berkomentar dengan sewajarnya. Terimakasih