Form movement control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to have two forms open (Threaded) and while you move one form,
have the other form follow. (and vise versa)
 
dwilliamjoe said:
Is it possible to have two forms open (Threaded) and while you move
one form, have the other form follow. (and vise versa)

I assume you want to have the two forms 'glued' together, so that as one
form moves the other form moves with it.

You can easily do this by creating a function that positions the second form
wherever you want relative to your first form, for example, the following
code will position the form referenced by the myForm2 variable so that it's
positioned to the right edge of the main form. Moving or resizing the main
form will cause the second form to move accordingly.

\\\
Private Sub MoveSecondForm()
myForm2.Location = New Point(Me.Left + Me.Width, Me.Top)
End Sub
///

This can then be called from the LocationChanged and SizeChanged events of
your main form.

You'll need to do a little extra work to handle the main form being
minimized, maximized, closed, etc. but this should get you started.
 
dwilliamjoe said:
Is it possible to have two forms open (Threaded) and while you move one
form,
have the other form follow. (and vise versa)

What does "threaded" mean in this context? Simply add a handler to the
form's 'Move' event and position the other form accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top