加个PictureBox 鼠标动的时候改变PictureBox 位置
private bool isButtonDown = false;
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
this.isButtonDown = true;
} private void Form1_MouseUp(object sender, MouseEventArgs e)
{
this.isButtonDown = false;
this.pictureBox1.Hide();
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (isButtonDown)
{
this.pictureBox1.Show();
this.pictureBox1.Top = e.Y;
this.pictureBox1.Left = e.X;
}
}
private bool isButtonDown = false;
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
this.isButtonDown = true;
} private void Form1_MouseUp(object sender, MouseEventArgs e)
{
this.isButtonDown = false;
this.pictureBox1.Hide();
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (isButtonDown)
{
this.pictureBox1.Show();
this.pictureBox1.Top = e.Y;
this.pictureBox1.Left = e.X;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货