QUOTE(fooboo @ 2 Jul, 2009 - 06:37 AM)

I don't think I'm doing it right. I am unfamiliar with creating my own events so I think I've screwed it up. It can't find definitions for IsMousDown and LastCursorPosition.
You should post your code.
Did you do what the instructions said at section 2?
QUOTE
2. Add these variables to the class:
- private Point LastCursorPosition;
- private bool IsMouseDown;
If you added them, they should be found.
Then you should just add these events to the form and add the code that was on the snippet:
CODE
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
bool IsMouseDown = false;
Point LastCursorPosition;
private void Form1_MouseDown(object sender, MouseEventArgs e) {
IsMouseDown = true;
LastCursorPosition = new Point(e.X, e.Y);
}
private void Form1_MouseUp(object sender, MouseEventArgs e) {
this.Location = new Point(this.Left - (this.LastCursorPosition.X - e.X), this.Top - (this.LastCursorPosition.Y - e.Y));
this.Invalidate();
}
private void Form1_MouseMove(object sender, MouseEventArgs e) {
this.IsMouseDown = false;
}
I hope this helps you.