Hi everybody,
A ComboBox within a Form (modal dialog) does not open when clicked, however an item can be selected by using the up/down arrow keys.
After clicking on another window and the back on the dialog, the ComboBox works as expected, i.e. expands on click.
Weird... any ideas what could be causing this behavior?
Thanks a lot in advance, Peter
EDIT: The Combobox is created by compile time, but populated by runtime.
Invalidating Combobox and enclosing Form did not help.
Following Henk's suggestion, I tried adding a new Combobox using the designer, which results in exactly the same code the existing Combobox has. The new Combobox works fine when empty, but adopts the strange behavior as soon as set the datasource programmatically... Here's what I am doing:
comboBox1.DataSource = langs;
comboBox1.DisplayMember = "NativeName";
comboBox1.ValueMember = "Name";
(langs
is a List<CultureInfo>
with two entries)
Hmmmm. If I preset the Items property with any two items (e.g. "A", "B"), everything works fine..... Huh? This works for me, but seems odd. Is this a bug?
(No, not really, misconception on my side)