Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Borderless form move

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

Thank You.
Reply

#2
Bump~
Reply

#3
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
Reply

#4
(04-15-2017, 01:27 AM)Slasheree Wrote: 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
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Must have startup form or Submain() Janito 12 1,290 11-05-2015, 03:22 PM
Last Post: Joyce
  DISABLE Click-to-move mrmiguu 4 470 09-24-2013, 07:42 AM
Last Post: mrmiguu

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB 1.8.4 Theme © iAndrew 2016