- namespace xxx
- {
- public partial class Form1 : Form
- {
- Point p;
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_MouseDown(object sender, MouseEventArgs e)
- {
- p = e.Location;
- }
- private void button1_MouseUp(object sender, MouseEventArgs e)
- {
- p = e.Location;
- }
- private void button1_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.Button == System.Windows.Forms.MouseButtons.Left)
- \\this.button1.Location = new Point(this.button1.Left + (e.X - p.X), this.button1.Top + (e.Y - p.Y));
- bool buttonToImgbox();
- }
- }
- }
c# button拖拽
猜你喜欢
转载自blog.csdn.net/weixin_39235487/article/details/80063456
周排行