Borderless form move

Please tell me how to make a border less form move.

Thank You.

Bump~

Pseudo-code would probably go something along these lines

Create 3 variables:
int mx, my
boolean mmov

–- On form events —
MouseDown: (X and Y are received by parameter)
If inDraggableAreaCheckHere Then ’ inDraggableAreaCheckHere is where you calculate if the click was within an acceptable area (usually if clickY<10px or something like a windows top bar)
mx = X
my = Y
mmov = True
End If

MouseUp:
mmov = False

MouseMove: (X and Y are received by parameter)
If mmov Then
Form.x = Form.x - (X-mx)
Form.y = Form.y - (Y-my)
End If

@‘Slasheree’:

Pseudo-code would probably go something along these lines

Create 3 variables:
int mx, my
boolean mmov

–- On form events —
MouseDown: (X and Y are received by parameter)
If inDraggableAreaCheckHere Then ’ inDraggableAreaCheckHere is where you calculate if the click was within an acceptable area (usually if clickY<10px or something like a windows top bar)
   mx = X
   my = Y
   mmov = True
End If

MouseUp:
mmov = False

MouseMove: (X and Y are received by parameter)
If mmov Then
   Form.x = Form.x - (X-mx)
   Form.y = Form.y - (Y-my)
End If

Thank you

Log in to reply