W
Wolfgang Kaml
Hello everybody,
seems like I got a challenging problem with the Listbox that really gets me
confused. Please have a look at the following code and output during runtime
from the Interactive Command Window:
--------------------------------------------------
? Me.LstLeistungen.GetType.FullName
"System.Windows.Forms.ListBox"
? Me.LstLeistungen.Items.Item(0).TEXT
"StringAtPos0" {String}
String: "StringAtPos0"
? Me.LstLeistungen.Items.Item(7).TEXT
"StringAtPos7" {String}
String: "StringAtPos7"
? Me.LstLeistungen.SelectedIndex
7
? Me.LstLeistungen.Items.Item(Me.LstLeistungen.SelectedIndex).TEXT 'just
looking at this statement....
"StringAtPos7" {String}
String: "StringAtPos7"
? Me.LstLeistungen.SelectedItem.TEXT
'and looking at this statement at the same time, the output does not make
sense. HELP!!!
"StringAtPos0" {String}
String: "StringAtPos0"
--------------------------------------------------
As you can see, SelectedIndex reports that item at index 7 is currently
selected, which is the true output looking at the GUI. The item at index 7
shows as selected in the listbox. However, for some reason, if I try to
retrieve that object with using the SelectedItem function, I get the object
at index position 0.
Does that make any sense whatsoever? Any idea, as of why that could
happen? - No overloading occured, I did not derive the Listbox, nothing.
Thank you for any help on that!
Wolfgang
seems like I got a challenging problem with the Listbox that really gets me
confused. Please have a look at the following code and output during runtime
from the Interactive Command Window:
--------------------------------------------------
? Me.LstLeistungen.GetType.FullName
"System.Windows.Forms.ListBox"
? Me.LstLeistungen.Items.Item(0).TEXT
"StringAtPos0" {String}
String: "StringAtPos0"
? Me.LstLeistungen.Items.Item(7).TEXT
"StringAtPos7" {String}
String: "StringAtPos7"
? Me.LstLeistungen.SelectedIndex
7
? Me.LstLeistungen.Items.Item(Me.LstLeistungen.SelectedIndex).TEXT 'just
looking at this statement....
"StringAtPos7" {String}
String: "StringAtPos7"
? Me.LstLeistungen.SelectedItem.TEXT
'and looking at this statement at the same time, the output does not make
sense. HELP!!!
"StringAtPos0" {String}
String: "StringAtPos0"
--------------------------------------------------
As you can see, SelectedIndex reports that item at index 7 is currently
selected, which is the true output looking at the GUI. The item at index 7
shows as selected in the listbox. However, for some reason, if I try to
retrieve that object with using the SelectedItem function, I get the object
at index position 0.
Does that make any sense whatsoever? Any idea, as of why that could
happen? - No overloading occured, I did not derive the Listbox, nothing.
Thank you for any help on that!
Wolfgang