看了好多帖子,但都没用特别满意的答案
------解决方案--------------------
你可以用消息过滤器 IMessageFilter ,来判断对象句柄是否panel的句柄,如果不是,就隐藏
------解决方案--------------------
Private Sub frm_linq_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseClick
Dim s As Region = New Region(Me.Panel1.RectangleToScreen(Me.Panel1.DisplayRectangle))
If Me.Panel1.Visible = True AndAlso Not s.IsVisible(e.Location) Then
Me.Panel1.Visible = False
End If
End Sub
------解决方案--------------------
来个简单的:在空白处来个panel2,如果焦点落在panel2上,就。。。。或者鼠标单击双击在panel2上。。。。。