newb help

  • Thread starter Thread starter Troy
  • Start date Start date
T

Troy

Hello,

I'm storing my student objects in a list box and using the displaymember to
display to display the student first name and lastname.

lstStudents.DisplayMember = "LastFirst"

Dim tmpStudent As Student
For Each tmpStudent In mStudents
lstStudents.Items.Add(tmpStudent)
Next
lblCount.Text = mStudents.Count.ToString()

Now i need to extract the objects from the list based on user selection. I
know it has something to do with selecteditem but cant figure it out.

Help is appreciated

thanks
 
Hi,

Dim tmpStudent As Student

Try
tmpStudent = Ctype(lstStudents.selecteditem,student)
catch
' error getting data
end try

Ken
 
thanks

Ken Tucker said:
Hi,

Dim tmpStudent As Student

Try
tmpStudent = Ctype(lstStudents.selecteditem,student)
catch
' error getting data
end try

Ken
 

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

Similar Threads


Back
Top