private void
Form1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
cursorOffset=new
Point(e.X,e.Y);
currentPos=new
Point(e.X,e.Y);
if(inborder)
{
sizing=true;
this.Capture=true;
}
else
{
moving=true;
this.Cursor=Cursors.SizeAll;
}
}
private
void Form1_MouseUp(object
sender, System.Windows.Forms.MouseEventArgs e)
{
if(!sizing
& closerPos==45 & e.X>this.Size.Width-23 & e.Y<23)
Application.Exit();
if(sizing
| moving)
{
sizing=moving=false;
this.Capture=false;
}
//do
non-border mouseup actions here
}
Private Sub
Form1_MouseDown(ByVal sender
As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseDown
cursorOffset
= New Point(e.X, e.Y)
currentPos
= New Point(e.X, e.Y)
If
inborder Then
sizing = True
Me.Capture
= True
Else
moving = True
Me.Cursor
= Cursors.SizeAll
End
If
End
Sub 'Form1_MouseDown
Private
Sub Form1_MouseUp(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseUp
If
Not sizing And
closerPos = 45 And e.X >
Me.Size.Width - 23 And
e.Y < 23 Then
Application.Exit()
End
If
If
sizing Or moving Then
sizing = False
moving = False
Me.Capture
= False
End
If
'do
non-border mouseup actions here
End
Sub 'Form1_MouseUp