By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

newb help

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Dim tmpStudent As Student

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

Ken
----------------------------------
"Troy" wrote:
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

Nov 21 '05 #2

P: n/a
thanks

"Ken Tucker [MVP]" <Ke**********@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
Hi,

Dim tmpStudent As Student

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

Ken
----------------------------------
"Troy" wrote:
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.