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 MartinsPosted Jun 18, 2010, 5:57 PM
lblCurrentDoorTag.Text = CType(Me.lstDoorTags.Items(pIntIndexOfSelectedItem) , ClassDoorTag).DoorTag.ToString()
MikePosted Jun 19, 2010, 9:28 AM
MikePosted Jun 18, 2010, 3:33 PM
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.
PJ MartinsPosted Jun 18, 2010, 3:21 PM
Me.lblCurrentDoorTag.Text = CType(Me.lstDoorTags.Items(pIntIndexOfSelectedItem) , ClassDoorTag).<