在这个Panel容器里的每个控件的 LostFocus 事件里编写代码:(当然可以自定义编写一个独立过程或函数,在这些控件的 LostFocus 事件里去调用) Dim ct As Control Dim YesNo As Boolean = False For Each ct In Panel1.Controls If ct.Focused Then YesNo = True Exit For End If Next If Not YesNo Then Panel1.Visible = False