c# winfrom项目,怎么实现鼠标移出弹出窗口自动隐藏该窗体

c# winfrom项目,如何实现鼠标移出弹出窗口自动隐藏该窗体 。
在C# Winfrom项目中,两个from窗体中,在第一个from1窗体中有个Button控件(实现点击该按钮弹出from2窗体)
在第二个from2窗体中有一个Panel控件,Label控件以及三个Button控件(button1、button2以及button3)。

请问怎么样实现在弹出from2窗体后,
鼠标移到form2窗体后,有可以点击了button1、button2、button3或鼠标放在了Panel控件,Label控件后再离开from2窗体。
这么样让鼠标在移出from2窗体后该from2窗体自动隐藏;

附上自己写的移出from2窗体后该from2窗体自动隐藏,但是如果用户鼠标点在了button1、button2、button3或鼠标放在了Panel控件,Label控件后再离开from2窗体,该代码就不行了。
 private void panel1_MouseLeave(object sender, EventArgs e)
        {
 
            Rectangle rect = panel1.Bounds;  
            int x =MousePosition.X - this.FindForm().Left;  
            int y = MousePosition.Y - this.FindForm().Top;  
            if (x <= rect.Left || x >= rect.Right || y <= rect.Top || y >= rect.Bottom)  
            {   
             
                this.Cursor = Cursors.Default;
                this.Hide();
            }  

        }


请各位帮忙看看,有没有相关的解决办法。谢谢! 




------解决思路----------------------
搜一搜鼠标API,获取鼠标位置,判断是否在窗体范围内
------解决思路----------------------
调用鼠标API,获取全局鼠标信息,不要靠窗体中的鼠标事件
------解决思路----------------------
判断鼠标的X,Y位置是不是在这个弹出窗口的Form范围内