public partial class UcIssueBill : UserControl, IMessageFilter
{
……………………
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == 0x201)//鼠标左键单击
{
Control ctrl = Control.FromHandle(m.HWnd);
bool found = false;
if (null != ctrl)
{
while (null != ctrl.Parent)
{
if (ctrl.Parent == this)
{
found = true;
break;
}
ctrl = ctrl.Parent;
}
if (found)
{
this.com_Click(this, new EventArgs());
}
}
return false;
}
}