Use Window form Button and Label control in VB.NET
In this article I will show to how to use Button and Label control in window form application.
In this article I will show to how to use Button and Label control in window form application.
The step by step methods of start a windows based application form and add controls on the forms.
- Start Microsoft visual studio
- Go to the File menu and then in New and click on Project.
- Select Template Visual Basic and Application Type Windows Forms Application.
- Give the Name and Location To save Project . (Like WindowsApplication1 and C:\visual studio 2010\Projects)
- You can now add Controls on form by using Toolbox which is left side of the IDE.
-
Add a Label : There is Three way to add a Label on Form:
a. Double click on Label in Toolbox .
b. Drag Label From Toolbox and Drop on Form.
c. Double Click on Form and Write the Code for Adding a Label on Form.
Private Sub Label1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Label1.Click
End Sub
- Same Above Three Steps are using for Add Textbox Control on Form.
a. Double click on Textbox in Toolbox .
b. Drag Textbox From Toolbox and Drop on Form.
c. Double Click on Form and Write the Code for Adding a Textbox on Form.
Private Sub TextBox1_TextChanged(ByVal sender As System.Object,ByVal e AsSystem.EventArgs) Handles TextBox1.TextChanged
End Sub
- Now You Can Debug Your Program By pressing F5 or Directly press the Debug Button on Standard Toolbar.
- The Output Screen is Show.
Summary
In this small article you have learned how to use Button and Label control in window form application.