MDI Child form positioning Questions:


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: MDI Child form positioning Questions:

  1. #1
    Join Date
    Mar 2005
    Posts
    57

    MDI Child form positioning Questions:

    Hi,

    I have changed my forms from SDI to MDI. I had to change my child forms from Modal to Modeless.

    Q1.) Since the child forms are modeless now, it is easy for the user to move them and change the focus to another child form. How do you keep users from switching between child forms without interacting with them first.

    Example: I don't want my user to go back to the first child form unless he/she hits the back button. Can you do this with MDI forms?

    Q2.) How can I control the startup position of my child forms?



    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    MDI is designed for apps that manipulate multiple instances of the same type of document (e.g., Visual Studio can open several source files simultaneously; MS Word can open several Word documents simultaneously, etc.) In those kinds of apps, it's advantageous for the user to be able to easily move among the documents.

    If you're using MDI for an app that's not manipulating documents, you're going to have an uphill battle; you're using MDI for something other than that for which it was designed. I recommend that you rethink your user interface. What kind of app is it? What kind of user experience are you going for?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2005
    Posts
    57
    Okay. Maybe I shouldn't go that route.

    Thanks

  4. #4
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    Why do you need to change from modal on the mdi child forms?

    If you set Border to 'none' the user does not have anything to drag around, and you can prevent other things happening until they click an appropriate button.

  5. #5
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Gupex: What is the advantage of a Multiple Document Interface in that case? If the app limits the user to working with one form at a time, why not use a Single Document Interface?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  6. #6
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    Phil,

    One reason we use mdi's is to have a main form with a ListBar (mdichild) on the left for navigating (like Outlook) and, depending upon what is selected, then show another mdi child beside the listbar but still nicely enclosed within the main form

    Greg

  7. #7
    Join Date
    Mar 2005
    Posts
    57
    Yea gupex , thats basicly what I was thinking. I don't actually have to make my program MDI but I thought if I had all my pop-up menus confined to a main form that it would be nice. I was just testing it out to see what I liked better.

  8. #8
    Join Date
    Mar 2005
    Posts
    57
    Okay, I set my borders to none and it did the trick. Thanks.

  9. #9
    Join Date
    Mar 2005
    Posts
    57
    1 more thing...

    When I show a different form it always shows it to the right and down a little from the last form. After it does that about 6 times it starts back in the top left corner of the main form. Is their a way to keep the positioning of each form the same and consistent every time (using MDI)?

  10. #10
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    set the .left & .top properties either on form load (if you unload it) or form activate.

  11. #11
    Join Date
    Mar 2005
    Posts
    57
    That works great thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center