标签:form roc toc poi ase ram control == controls
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);
}
实现点击Form区域内除ListBox以外的其他地方,实现ListBox的隐藏,包括UserControl范围内,也包括UserControl之外Form之内
标签:form roc toc poi ase ram control == controls
原文地址:http://www.cnblogs.com/FInerProgrammer/p/7048584.html