如何实现用鼠标移动按钮 如何实现用鼠标移动按钮,我是新手 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个在实际中没多大用吧思路如下取得当前MOUSE的坐标,再控件BUTTON控件到当前坐标下…… 我就是不知道怎么把控件移到当前位置下,用那个函数,是在mousemove事件实现吧 private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { this.button1.Left=e.X; this.button1.Top=e.Y; }分啊 分啊 我要分~ 用我这个方法就可以跟着鼠标移动了~~~~ 只能在WINDOWS程序中使用,不能想在网络下使用……因为服务器不可能去处理你客户端MOUSE的动作 private void button1_MouseDown(object sender, MouseEventArgs e) { isDown = true; } private void button1_MouseUp(object sender, MouseEventArgs e) { isDown = false; } private void Form1_MouseMove(object sender, MouseEventArgs e) { if(isDown) { this.button1.Left = e.X; this.button1.Top = e.Y; } }我是这样写的,当鼠标按下并移动鼠标时移动按钮,但是好像不行啊,移动不了 private void button1_MouseDown(object sender, MouseEventArgs e) { isDown = true; } private void button1_MouseUp(object sender, MouseEventArgs e) { isDown = false; } private void Form1_MouseMove(object sender, MouseEventArgs e) { if(isDown) { this.button1.Left = e.X; this.button1.Top = e.Y; } }我晕~~ 你不是吧 MouseUp isDown = false; ............这里永远是 false 当然不会移动~~~ 怎么可能,我的意思是鼠标在按钮那里按下,然后拖着按钮移动,鼠标松开就不移动按钮了,所以当鼠标按下时isDown应该是true的 总提示'Categories' 附近有语法错误。 求一個運行速度快的方法 什么情况下用到多线程!给个事例 C#发邮件? 急死我了!!!!请问如何把一个中文的字符串保存在一个byte数组里面 如何制作类似QQ风格的窗体界面 请问一个关于sp短信开发方面的问题 xp pro 装了.NET03 ,为什么http://localhost不能显示?我已经设置虚拟目录 请大家帮帮忙,如何读取ftp服务器上的图片啊???急!!! 如何在C#WinForm中接收VC+ATL编写的普通COM(无界面)的事件? 有人知道DataSet里怎么实现update Sysdate? 一个简直class求解?
{
this.button1.Left=e.X;
this.button1.Top=e.Y;
}分啊 分啊 我要分~ 用我这个方法就可以跟着鼠标移动了~~~~
{
isDown = true;
} private void button1_MouseUp(object sender, MouseEventArgs e)
{
isDown = false;
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if(isDown)
{
this.button1.Left = e.X;
this.button1.Top = e.Y;
}
}
我是这样写的,当鼠标按下并移动鼠标时移动按钮,但是好像不行啊,移动不了
{
isDown = true;
} private void button1_MouseUp(object sender, MouseEventArgs e)
{
isDown = false;
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if(isDown)
{
this.button1.Left = e.X;
this.button1.Top = e.Y;
}
}
我晕~~ 你不是吧 MouseUp isDown = false; ............
这里永远是 false 当然不会移动~~~