Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

MDI client problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tsiGeorge - 22 Dec 2004 21:51 GMT
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.
tsiGeorge - 25 Dec 2004 18:13 GMT
Update. Problem 2 changed "child.bounds = parents MdiClient.ClientRectangle" to
"child.Dock = DockStyle.Fill". Still waiting for a response from MS.

> 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
[quoted text clipped - 21 lines]
> parent is resized. Now the client is almost maximum size except it still has
> its own margins.
Tom Krueger [MSFT] - 15 Feb 2005 23:33 GMT
For question #2, would docking the form work?  You could set this
programatically.

Signature

Tom Krueger

My Blog - http://weblogs.asp.net/tom_krueger
Smart Client DevCenter - http://msdn.microsoft.com/smartclient/
Mobile DevCenter - http://msdn.microsoft.com/mobility

This posting is provided "as is" with no warranties and confers no rights.

> Update. Problem 2 changed "child.bounds = parents
> MdiClient.ClientRectangle" to
[quoted text clipped - 39 lines]
>> has
>> its own margins.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.