I'm quite confused about the way ComboBox's FindString() method works.
Consider the following example:
The first three output as you would expect 0, 1, 2 but the last one output's 0. ***? Who wrote this method anyway. I mean I could understand it returning -1 or something like that but it is returning 0 which is "Test 1" which is not null, and not an empty string "".
Consider the following example:
C#:
ComboBox myComboBox = new ComboBox();
myComboBox.Items.AddRange(new string[] { "Test1", "Test2", "Test3", "" });
MessageBox.Show(myComboBox.FindString("Test1").ToString());
MessageBox.Show(myComboBox.FindString("Test2").ToString());
MessageBox.Show(myComboBox.FindString("Test3").ToString());
MessageBox.Show(myComboBox.FindString("").ToString());
The first three output as you would expect 0, 1, 2 but the last one output's 0. ***? Who wrote this method anyway. I mean I could understand it returning -1 or something like that but it is returning 0 which is "Test 1" which is not null, and not an empty string "".