ต.ย. การเปลี่ยน รูปแบบตัวอักษร ขนาดตัวอักษร สีตัวอักษร ของ คอนโทรล (Button , Label ) ขณะรันโปรแกรม

ดัลเบิ้ล คลิกที่ Button1 แล้วเขียนคำสั่งดังนี้
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myFont As System.Drawing.Font
myFont = New System.Drawing.Font("angsana", 20, FontStyle.Bold Or FontStyle.Italic)
Button1.Font = myFont
Button1.Text = "My font was changed to this"
Button1.ForeColor = Color.Red
End Sub
|
:: คลิกที่ปุ่ม จะได้ผลลัพธ์ดังนี้

|