/// <summary>
/// 在调度消息之前将其筛选出来。
/// </summary>
/// <param name="m">要调度的消息。无法修改此消息。</param>
/// <returns>如果筛选消息并禁止消息被调度,则为 true;如果允许消息继续到达下一个筛选器或控件,则为 false。</returns>
public bool PreFilterMessage(ref Message m)
{
var pt = this.PointToClient(MousePosition);
isShow = this.ClientRectangle.Contains(pt);
return false;
}
实现IMessageFilter接口
在需要筛选的地方添加筛选:Application.AddMessageFilter(this);
删除筛选器:Application.RemoveMessageFilter(this);
posted on
浙公网安备 33010602011771号