4
Answers

Retrieving text from selected item in a listbox VB.NET

Mike

Mike

14y
4.3k
1

I am having trouble retreiving the actual text from the selected item in a listbox.    The listbox only allows one selected item at a time. 
I have tried this: Me.lblCurrentDoorTag.Text = (Me.lstDoorTags.Items(pIntIndexOfSelectedItem).ToString), but it returns ColdGuard_Design_Automation_System.ClassDoorTag

also tried this: me.lblCurrentDoorTag.Text = (Me.lstDoorTags.Text)
Sometime it works but other times it also returns ColdGuard_Design_Automation_System.ClassDoorTag

 

I have wasted a lot of time trying to find a solution to this problem.    What am I doing wrong?

Answers (4)