const int WM_PARENTNOTIFY = 0x210;
const int WM_LBUTTONDOWN = 0x201;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_LBUTTONDOWN || (m.Msg == WM_PARENTNOTIFY &&
(int)m.WParam == WM_LBUTTONDOWN))
{
if (tab.SelectedForm is Form)
{
Form form = tab.SelectedForm as Form;
var control = form.Controls.Find("combobox", true)[0];
if (control != null)
{
ComboboxEx combobox = control as ComboboxEx;
if (!combobox.ClientRectangle.Contains(combobox.PointToClient(Cursor.Position)))
{
combobox.HiddenListBox();
}
}
}
}
base.WndProc(ref m);
}