实现了提示控件(picture1)随着鼠标而移动,但点击时仍会显示(是一个BUG)
需要绑定事件到 form、panel1、picture1、等控件
private 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(); }