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?

PJ MartinsRank #2,548 · 548 reputationPosted Jun 18, 2010, 1:57 PM EDT
lblCurrentDoorTag.Text = CType(Me.lstDoorTags.Items(pIntIndexOfSelectedItem) , ClassDoorTag).DoorTag.ToString()
PJ MartinsRank #2,548 · 548 reputationPosted Jun 18, 2010, 11:21 AM EDT
Me.lblCurrentDoorTag.Text = CType(Me.lstDoorTags.Items(pIntIndexOfSelectedItem) , ClassDoorTag).<
Mike6 reputationPosted Jun 18, 2010, 11:33 AM EDT
frmMainParameters.lstDoorTags.DisplayMember = "DoorTag"
frmMainParameters.lstDoorTags.ValueMember = "DoorTagID"
The list correctly displays the doortags but when I try to set a label equal to the text of the currently selected item in the list box, the label text is set to ColdGuard_Design_Automation_System.ClassDoorTag.
If I use me.lblCurrentDoorTag.Text = (Me.lstDoorTags.Text) to set the label text, it works part of the time, but at other times I get the same result as above.
Mike6 reputationPosted Jun 19, 2010, 5:28 AM EDT