[转][C#]自定义提示控件
2021-05-15 20:28
标签:sele col false leave contains rgba sel bounds 定义 实现了提示控件(picture1)随着鼠标而移动,但点击时仍会显示(是一个BUG) 需要绑定事件到 form、panel1、picture1、等控件 [转][C#]自定义提示控件 标签:sele col false leave contains rgba sel bounds 定义 原文地址:https://www.cnblogs.com/z5337/p/14674831.htmlprivate void panel1_MouseMove(object sender, MouseEventArgs e)
{
//timer1.Start();
var p = PointToClient(MousePosition);
Debug.WriteLine("MouseMove.{0},{1}", p.X, p.Y);
pictureBox1.Location = p;
pictureBox1.Show();
}
private void panel1_MouseLeave(object sender, EventArgs e)
{
//pictureBox1.Visible = false;
var p = PointToClient(MousePosition);
Debug.WriteLine("MouseLeave.{0},{1}", p.X, p.Y);
if (panel1.Bounds.Contains(p) || button1.Bounds.Contains(p))
{
//pictureBox1.Location = p;
//pictureBox1.Show();
}
else
pictureBox1.Hide();
}
上一篇:拥抱变化,全新的WinUI
下一篇:c# 时间区间求并集