Button Control

Windows Forms controls are reusable components that encapsulate user interface functionality and are used in client side Windows applications. A Button is a control, which is an interactive component that enables users to communicate with an application which we click and release to perform some actions.

The Button control represents a standard button that reacts to a Click event. A Button can be clicked by using the mouse, ENTER key, or SPACEBAR if the button has focus.

When you want to change display text of the Button , you can change the Text property of the button.

Similarly if you want to load an Image to a Button control , you can code like this.

The following source code shows how to change the button Text property while Form loading event and to display a message box when pressing a Button Control.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Text = "Click Here"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    End Sub

End Class (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About