VB.NET Examples


This is a simple treeview example in vb.net.We see how to add treenodes at three levels.First Node,which is our root node,in this case country.Second level node,in this case Country and finally third-leve node in this case cities,where we add multiple cities.


Here is simple VB.NET menu example.We select a menu item and show a Message Dialog with selected item.


ListView in VB.NET and .NET general is powerful component that can render lists or tables of data.

It's customizable and powerful and can be used with a variety of data source through data binding.

However, we can also add data programmatcially by creating ListViewItems and adding them.

This means that we can create our rows using custom logic. Moreover ListView is flexible and allows us even render binary data like images in our rows.

In this class we render both images and text in our ListView.

Here we explore vb.net ListView.How to load and show images and text from our file system into our listview.


Here we explore vb.net listview with context menu.We populate our listview with data.When a single row is selected and right-clicked,a context menu is displayed in our listview with delete option.When we click delete,dummy data gets deleted from our listview.

Sorting data is such important operation when it comes to dealing with modern software. It helps the user easily reach the specific data he needs without necessarily having to go through the whole dataset line by line. This is a VB.NET tutorial.

We see how to sort a listbox data in an ascending or descending order. This is a very basic example. We simply use an Array to sort and reverse our data. The array is then bound to a listbox.


This is a simple play with two listboxes.We select a single item in a listbox and transfer it to the next listbox on button click.We can transfer in both directions.


This is a VB.NET tutorial, ListBox sorting ascending and descending.We sort when the user clicks a button,toggling between ascending and descending. This is the plan :

  • We first fill up an array with data.
  • Then bind the array to our ListBox.
  • When the user clicks the sort button we sort ascending first.
  • When he clicks again,we sort descending and vice versa.

In this simple vb.net example,we see how to get and show in message box or set date using the datetimepicker vb.net component.


This is a VB.NET datagridview example.We see how to hide or show either the rows or columns.

  • We populate our vb.net winforms datagridview with data.
  • The datagridview has multiple rows and columns.
  • When the user clicks hide button with a given row or column selected,we hide that row or column.
  • When the user clicks show button with a given row or column selected,we show that row or column if it was hidden.

Here we see how to display images in a grid with three columns.In fact its the datagridview we are playing with here.We use the datagridviewimagecolumn to show our images.When an image is clicked,we display its index in a message box.