VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Move forms together

Andre Koester  (1 Submission)   Custom Controls/Forms/Menus   Visual Basic 3.0   Beginner   Wed 3rd February 2021

Move forms together as if they were docked.
No Timer needed!
I had to separate forms used as a kind of toolbox. My idea was, that it would be nice if I could move these two together if they were both active. VB doesn't tell me when my form is moved. But then I realised that I read s.th. about moving forms without a titlebar. Using this trick my code will perform the following action:
1. The form detects a mousedown event
2. The mouse is released and the form moved by FormDrag
3. The other form is notified of the movement
4. The other form will follow the first
Don't forget to vote if you like it ;o)

API Declarations
Declare Sub ReleaseCapture Lib "user32" ()
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long

Rate Move forms together (2(2 Vote))
Move forms together.bas

Move forms together Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters