By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,887 Members | 1,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,887 IT Pros & Developers. It's quick & easy.

Form movement control

P: n/a
Is it possible to have two forms open (Threaded) and while you move one form,
have the other form follow. (and vise versa)
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
dwilliamjoe wrote:
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.

--

(O) e n o n e
Nov 21 '05 #2

P: n/a
"dwilliamjoe" <dw*********@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.