So I have a set up like the answer for this post: display list of custom objects as a drop-down in the PropertiesGrid , where I have a property tree and I need one of them to have a dropdown which I fill from a string array.
Im using IWindowsFormsEditorService to have a drop down. I create the list box:
IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
ListBox lb = new ListBox();
lb.SelectionMode = SelectionMode.One;
lb.SelectedIndexChanged += OnListBoxSelectedValueChanged;
lb.Items.AddRange(myStringArray)
service.DropDownControl(lb);
The OnListBoxSelectedValueChanged event I have:
service.CloseDropDown();
However the dropdown doesn' close and I dont know why. It works fine until that point.
From other code examples I have found, it should be working. If I click elsewhere on the property tree it does close, but why doesn't it close on SelectedIndexChanged? Is there something with the listBox control that is overriding that? Other then what is above, I have no other listBox properties set.