鼠标移动到QQ头像时就会显示一个窗体,鼠标离开就关闭窗体,用C#怎么写?

2024-12-04 23:30:40
推荐回答(1个)
回答1:

这应该是个Panel吧,在显示头像的控件里加一个MouseEnter事件,处理Panel1.Visible = true;再加一个MouseLeave事件,处理Panel1.Visible = false;如: private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
panel1.Visible = true;
} private void pictureBox1_MouseLeave(object sender, EventArgs e)
{
panel1.Visible = false;
}