Table of Contents
hide
Example: How to Set Hotkeys with Button Letters.
Example : How to type/display ‘&’ Key/letter in VB .net 2013.(click this link)
Example : How to close the VB form/application.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Application.Exit()
---------------- OR ---------------
'Me.Close()
---------------- OR ---------------
'Me.Dispose()
---------------- OR ---------------
'End
---------------- OR ---------------
End Sub
Example : How to Set the Value/Name of Button dynamically.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button1.Text = "Close"
Button2.Text = "Exit"
End Sub
Example : How to Set the Backcolor and Forecolor of a Button dynamically.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button1.BackColor = Color.Red
Button2.ForeColor = Color.DeepPink
End Sub
Example : How to make the Button Inactive/Active dynamically.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button3.Enabled = False
Button3.Enabled = True
End Sub
Example: How to make the Button Visible/Unhide or Hide dynamically.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button3.Visible = True
Button3.Visible = False
End Sub
0 Comments