FREE VB.NET SOURCE CODE

Showing posts with label microsoft visual studio. Show all posts
Showing posts with label microsoft visual studio. Show all posts

27 March, 2012

[SNP] ListBox Remove item / Clear / Display / Add [VB.NET]

Some useful ListBox codes/examples:

Adding an item:
ListBox1.Items.Add("TEST ITEM")

Remove all items from a ListBox:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Clear()
'using the clear method to clear the list box
End Sub 

Remove particular item from a ListBox:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles Button1.Click
ListBox1.Items.RemoveAt(4)
'removing an item by specifying it's index
End Sub 

Display selected ListBox item, to a TextBox:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
TextBox1.Text = ListBox1.SelectedItem
'using the selected item property
End Sub 

Count all items in a ListBox:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles Button1.Click
TextBox1.Text = ListBox1.Items.Count
'counting the number of items in the ListBox with the Items.Count
End Sub

Display ListBox item index:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
TextBox1.Text = ListBox1.SelectedIndex
'using the selected index property of the list box to select the index
End Sub 

The default ListBox event - selected index changed:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

End Sub 

[Link] Download VIsual Studio - IDE for Visual Basic [VB.NET]

For starters, an IDE stands for: Integrated development environment ,wich basicly is "the program" where you program ^^.

So when you finish your programming, it arranges all the files in a strict order and compiles your code in to .exe file.

Currently the best IDE for Visual Basic is Microsoft Visual Studio, that you can download from:

Microsoft Visual Studio 2010 - The Pirate Bay - Mirror #1
Mirror
Microsoft Visual Studio 2010 - The Pirate Bay - Mirror #2
Mirror
Microsoft Visual Studio 2010 - The Pirate Bay - Mirror #3
 Mirror
Microsoft Visual Studio 2010 - Demonoid - Mirror #4 


Or if you preffer the BETA version of Microsoft Visual Studio 2011, then download it from:

Visual Studio 2011 BETA - x86


For Visual Basic 6 , you convert the code for MVS2011/10/08 or use this IDE:
Visual Basic 6.0 - Portable
Mirror
Visual Basic 6.0 - Portable + Libs

If you need Microsoft Visual Studio 2008, then use theese links:
Microsoft Visual Studio 2008 Express Edition - Portable
Mirror
Microsoft Visual Studio 2008 Professional
If any of the links are not working, please tell me ^^

Good luck!