MDI client problems

G

Guest

In our app (VB) client forms are displayed based on what is on the current
client form and the button pressed. A user never selects a client form. You
can think of this process as filling out a very long form with many branches
(e.g., IRS form 1040). Once a client form is loaded it is never unloaded -
just hidden.

I need help resolving these 2 problems:

1) Focus on a text box. I know i can't set the focus in the Load event but
the Activated event only fires when the first client loads. Also, when the
form is redisplayed (i.e., made visible) txtbox.focus, for example, doesn't
work. What I do now is start a timer with a 10ms interval and set the focus
in the timer event. I also think that sometimes when I leave the text box the
Leave event doesn't always fire. There's got to be a better way.

2) Client form size. I would like the client form to be the maximum size
that will fit in the MDI parent. The minimum size of the client forms is set
to 720 X 540. If i set the WindowState to Maximized the first client is
displayed maximized but all the others are displayed at their minimum size.
When the first client form is redisplayed it is also displayed at the minimum
size. This just drives the users crazy. What I've done is after showing the
form the first time or making the form visible on redisplays I set the
child.bounds = parents MdiClient.ClientRectangle. I also do this if the
parent is resized. Now the client is almost maximum size except it still has
its own margins.
 
G

Guest

Update. Problem 2 changed "child.bounds = parents MdiClient.ClientRectangle" to
"child.Dock = DockStyle.Fill". Still waiting for a response from MS.
 

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