How to add item to list box to what index I want?

+2 INFERNO SAMA · January 22, 2015

I have five items and I want to add it in specific index in list box.
There are four buttons, each one get's path of selected files. Paths will be added to list box but I want each paths added in it's index in list box.
That is mean I don't want to get paths in sequence but in list box it will be ordered in sequence.
Here my code for one button:

If OpenVSFilter.ShowDialog = Windows.Forms.DialogResult.OK Then
            For Each file As String In OpenVSFilter.FileNames
                VSFilterBox.Text = OpenVSFilter.FileName
                ScriptBox.Items.Add(lblloadA.Text + VSFilterBox.Text + lblloadB.Text)
        End If

This will add path in random but I want it be added to index number 2 as an example.

Thank You.

Post a Reply


Oldest  Newest  Rating
0 INFERNO SAMA · January 25, 2015
Hi there,

I did it by own way.

  • 1

Visual Basic


One of the first products to provide a graphical environment and a paint metaphor for developing user interfaces.

Bucky Roberts Administrator