This question comes from the forum, and there is no difficulty and no need to redraw the content. Of course there is a way to send Wm_syscommand and sc_move through the API, that is, to drag the untitled form, but the effect is not this good.
Using System;
Using System.Drawing;
Using System.Windows.Forms;
Namespace WindowsApplication2
... {
public partial class Form1:form
... {
static string Strdown = @ "Aaacaaeaicaaaasacqawaqaafgaaacgaaaagaaaaqaaaaaeaaqaaaaaaaaiaaaaa
Aaaaaaaaaaaaaaaaaaaaaaaa////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Aaaaaaaaaaf4aaad8aaaa/aaaapwaaah+aaad/gaab/8aaa//aaan/waacf+aaah
9gaadbqaaa2waaajsaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Aaaaaaaa////////////////////////////////////////////8ap///gh///4
B///+af///ad///ga///wah//4ab//+aaf//gad//4aa///aap//4ah//+ah///g
D////j////////////////////////////////////////////8= ";
static string Strup = @ "Aaacaaeaicaaaaoacaawaqaafgaaacgaaaagaaaaqaaaaaeaaqaaaaaaaaiaaa
Aaaaaaaaaaaaaaaaaaaaaaaaaa////aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaf4aaad8aaaa/aaaapwaaah+aaad/gaab/8aaa//aaad/waagf+
Aaah9gaadbyaaa2yaaazsaaagbaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaa////////////////////////////////////////////8ap///
gh///4b///+af///ad///ga///wah//4ab//8aaf//aad//4aa///gap//4ad//
8af///ab///5a////5///////////////////////////////////////8= ";
Cursor Curup = new Cursor (New System.IO.MemoryStream (Convert.frombase64string (Strup)));
Cursor Curdown = new Cursor (New System.IO.MemoryStream (Convert.frombase64string (Strdown)));
Public Form1 ()
... {
InitializeComponent ();
This.pictureBox1.Cursor = Curup;
}
BOOL bdragging = false;
Point pclicked;
private void Picturebox1_mousedown (object sender, MouseEventArgs e)
... {
Bdragging = true;
pclicked = new Point (e.x, e.y);
This.pictureBox1.Cursor = Curdown;
}
private void Picturebox1_mousemove (object sender, MouseEventArgs e)
... {
if (bdragging)
... {
Point Omovetopoint;
Omovetopoint = this. PointToClient (Picturebox1.pointtoscreen) (New Point (e.x, e.y));
Omovetopoint.offset (Pclicked.x *-1, Pclicked.y *-1);
Picturebox1.location = Omovetopoint;
}
}
private void Picturebox1_mouseup (object sender, MouseEventArgs e)
... {
Bdragging = false;
This.pictureBox1.Cursor = Curup;
}
}
}