Windows Forms in VB.NET

This is a simple tutorial which shows you beginners how to create a WindForms application in VB.NET.
  • 2523
 
This is a simple tutorial, which shows you beginners how to create a WindForms application in VB.NET.

Create a new project by selecting 

File->New->Project->Visual Basic Projects->Windows Application option
 -

WinFormsInVBNET1.jpg

Pick a suitable directory and project name.

Now use Toolbox to add controls to the form. Drag-drop controls you want.

WinFormsInVBNET2.jpg

I add a listbox, a textbox, and a button and my form looks like this -

WinFormsInVBNET3.jpg

In this sample example, I will add textbox items to the list box on Button Click event

Now 
double click on the button to add a On click event handler and write this code - 

Protected Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs)
ListView1.InsertItem(0, TextBox1.Text)
End Sub

That's it. Compile and build your project. Piece of cake, huh?

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.