- namespace xxx
- {
- public partial class Form1 : Form
- {
- Point p;
- public Form1()
- {
- InitializeComponent();
- }
- privatevoid button1_MouseDown(object sender, MouseEventArgs e)
- {
- p = e.Location;
- }
- privatevoid button1_MouseUp(object sender, MouseEventArgs e)
- {
- p = e.Location;
- }
- privatevoid 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 drag and drop
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=324811686&siteId=291194637
Recommended
Ranking