Disabling ComboBox's DropDown Popup

  • Thread starter Thread starter Brian Takita
  • Start date Start date
B

Brian Takita

Hello,

Is it possible to disable the ComboBox DropDown ListBox control from the
OnDropDown override method?

I'm trying to use a ListView to popup, instead of a ListBox.

So far, I've been able to "disable" the dropdown by changing the focus
to the Listview

protected override void OnDropDown(System.EventArgs e) {
_popup.Show();
_popup.Focus();
base.OnDropDown(e);
}

However, the dropdown ListBox briefly flashes in front of the ListView.

Please let me know if you have a better solution. If there is a way to
set the dropdown box to a ListView control, that would be even better.

Thank you,
Brian Takita
 
Are you creating the ListView in response to the DropDown event?
Is so, try creating it with the dropdown listbox as a parent.
You can get the HWND of it by using GetComboBoxInfo

Then override ListView.CreateParams and sepecify that
HWND as a parent

/claes
 
I can get the HWND by using the
Handle property.

How do you get access to the dropdown ListBox in the ComboBox?
 
Back
Top