Setting MDI Child Form location programatically

T

Tom

I want to be able to 'make' a MDI Child Window appear at the same place in
my MDI container. For example, maybe I want this Child window to always
appear at Top=0 and Left=0; or, when the user exits my Child window, I save
the last location for that window, and then when the reopen the window I
want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window;
however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it too. How
can I make it appear at the location I want it to within the MDI container?

Thanks.

Tom
 
S

SStory

when you open your child....
Dim f As New Form1

f.StartPosition = FormStartPosition.Manual 'here's the key

f.Left = 0

f.Top = 0

f.MdiParent = Me

f.Show()
 

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

Top