Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Form Location problem

I have an MDI parent form which has treeview on left side and child forms gets loaded on clicking the tree node. When the application is started the child form fills the right side fully. but when it is re loaded by clicking on tree node, the child form changes its location....How to avoid this?. I have given the form.dockstyle = fill. All the windows are in Normal state(not maximized).

Wednesday, April 20, 2005

As I stated in your other post, it doesn't sound like you want to create a MDI application. This is just one of many issues that you are going to run into. The bottom line is that MDI child windows are meant to be controlled by the user... not your program. You have very little control and the user can easy circumvent your "lock-down" mechanisms. For example, the following keyboard shortcuts will probably create problems for you.

• ALT+- (ALT+hyphen): Displays the Multiple Document Interface (MDI) child window's System menu (from the MDI child window's System menu, you can restore, move, resize, minimize, maximize, or close the child window)

• CTRL+TAB: Switch to the next child window of a Multiple Document Interface (MDI) program

• CTRL+F4: Closes the current Multiple Document Interface (MDI) window

You haven't described enough of your program to really tell what you are trying to accomplish but it sounds like you may want to use User Controls instead of MDI Child Windows.

This is just my opinion and may not count for much. However, I tried once to make a "multi-page" program out of MDI child windows once and failed. I resorted to using User Controls that are added to the main window programatically at run time.

Wednesday, April 20, 2005

Thanks for your suggestion. we are not going for MDI, instead will use panels in main window inside which other forms will be loaded

Thursday, April 21, 2005

*  Recent Topics

*  Fog Creek Home