Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Borderless form move


deminizer
 Share

Recommended Posts

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
Link to comment
Share on other sites

@'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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...