Problem with mdi child forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SpeedJunkie
    New Member
    • Mar 2009
    • 12

    Problem with mdi child forms

    Hi,
    I have 2 child forms. User can maximize one child form and he's not allowed to maximize the second child form.
    Now i am facing a problem, when one child form is already open and is in maximized state the form which user is not allowed to maximized is also getting opened in maximized state.

    I have tried opening the 2nd form by setting the form window state to normal but to no avail.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Does supplying a maximumsize to the child form that shouldn't be maximized help?

    Have you tried handling the form resize events?
    I think you can check to see if the form is being "maximized" and prevent the event from happening?

    Comment

    • SpeedJunkie
      New Member
      • Mar 2009
      • 12

      #3
      My problem is something else.
      I have 2 forms in my application say Form1 and Form2.
      User can not maximize Form2 and i have made formborderstyle as FixedDialog.
      Now let's say user has opens form1 and maximizes it, now when he opens form 2 it also opens in maximized state.I don't want to let this happen. I want that the Form2 should open in size that i specified in the design time.
      I hope I making some sense.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Hmm I have never run into this problem with non mdi-forms. My forms open up at the correct size.
        Is there a reason you have made them MDI children and not just opened them?
        Maybe you can get away with non-mdi forms?
        Pretty sure its a property of being an MDI child to take on similar behavior as a previous child. Like the way ms office product work. If you use ctrl+tab to cycle through children. If one child is "maximized" , regardless of the previous states of the other children, the next child will also be maximized.

        Comment

        • SpeedJunkie
          New Member
          • Mar 2009
          • 12

          #5
          Thnx for your reply Plater...
          Yes you are right there, if the forms are not mdiChild you would not face this problem.
          I don't want to make my forms non mdiChild 'coz then they show independent of the main form.
          Right now, as a temp fix when i open Form two i check if active child is maximized if yes then i make the window state as normal and then open Form 2. But then this does not look very good to users as Form1 resizes and looks kinda irritating to user.
          I was wondering if there is any way that Form1 stays maximized and Form2 is in the normal size.....

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Pretty sure there isn't as long as they are both children of the same parent.

            Comment

            • SpeedJunkie
              New Member
              • Mar 2009
              • 12

              #7
              Thnx anyway Plater....

              Comment

              Working...