last seleced item of listbox

H

Hei

Hi,

When a listbox SelectionMode set to MultiSimple, how can i know the last
selected item?

thx
Hei
 
C

Cor

Hi Hei,

Here an example with all some questions in one
\\\
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Me.ListBox1.SelectionMode = SelectionMode.MultiSimple
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim i As Integer
Dim b As String
Me.ListBox1.SelectionMode = SelectionMode.MultiSimple
For i = 0 To ListBox1.SelectedItems.Count - 1
b = b & ListBox1.SelectedItems(i).ToString & " "
Next
MessageBox.Show(b)
End Sub
///

I hope this helps a little bit?

Cor
 
H

Hei

hi Cor,

i have try these code, it is very interest of selecteditems, it items is
sorted. So, when user select form top to bottom is fine, therwise
....

:)
Hei
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top