Subclass frmMain, using code such as found at
http://www.mvps.org/vbnet/code/subclass/minmaxinfo.htm. Add this const to
the bas module ...
Private Const WM_MOVING As Long = &H216
... and replace the WindowProc method with this instead (where frmMain it
the form that will be moved, and Form1 is the form you want to 'follow' the
main form ...
Public Function WindowProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
On Local Error Resume Next
Select Case hwnd
Select Case uMsg
Form1.Move (frmMain.Left + frmMain.Width), frmMain.Top
WindowProc = CallWindowProc(defWindowProc, _
Click the titlebar of frmMain and begin to move .. Form1 will follow beside
it. Tweak as desired.
MVP Visual Basic
Please respond only to the newsgroups so all can benefit.
> Hey All...
> I'm trying to move 2 forms at once. I have one window that pops-up
> (B), and I have a little pushpin that moves the left property of
> window B to the rightside of the other form, A. But, when I move form
> A, the other window doesn't go with it, obviously. Is there a method
> I'm missing that could help me move both together as one entity? Or
> an API call that I could use to accomplish this?
> Any help is greatly appreciated! Thanks in advance..
> - Kevin