CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Location
    Traverse City, MI
    Posts
    24

    MDI Oddball issues

    Hey All,

    I have an MDI parent Container, I dock a tree view control to the left of that container, and bring up various child forms on the right side of that container. Im having an issue with this, I dont want the user to beable to resize or move the child forms I bring up, I want it all done through the treeview control. When I maximize the code in the form, I set the Control Box, Minimize, and Maximize properties to false, but for some odd reason it still displays the control box and other buttons in the file menu bar of the parent container. The funny thing is, it has disabled the close and minimize buttons. Another odd point to consider is that the restore button is enabled, so if the user clicks it, my form will shrink down to its original size, but after you click the restore button and only after you click the restore button, the control box goes away. Heres the code

    this.SuspendLayout();
    Form cForm = new Form();
    cForm.MdiParent = this;
    cForm.WindowState = FormWindowState.Maximized;
    cForm.FormBorderStyle = FormBorderStyle.None;
    cForm.MaximizeBox = false;
    cForm.MinimizeBox = false;
    cForm.ControlBox = false;
    cForm.Show();
    this.ResumeLayout();

    Any Ideas would be greatly appreciated.

    Thanks,
    Ryan

  2. #2
    Join Date
    Mar 2003
    Location
    Traverse City, MI
    Posts
    24
    By the way, anyone else who runs into this problem might be helped but a little work around I've found. If you set the form to minimized initially, then call the form show method, and after that call the form maximized method, you get the desired effect. You just have to deal with the little annoying effect of the form going from minimized to maximized, which isnt really that bad.

    Thanks,
    Ryan

  3. #3
    Join Date
    Jun 2003
    Posts
    9

    Unhappy Better solution

    Hi

    Is there a more elegant solution?

    Thanks

    kaennon

  4. #4
    Join Date
    Mar 2003
    Location
    Traverse City, MI
    Posts
    24
    Well, I have gone in a different direction with my application. I think one of the users here suggested I use user controls, which I did. It completely fixed the flicker problem. I just simply user controls, which are alot like forms as far as methods and properties, and threw the controls in a panel. It works pretty well actually, .Net handles user created controls really well.

    Hope this helps,
    Ryan

  5. #5
    Join Date
    Jun 2003
    Posts
    9

    Talking MDI Form

    Hi,

    but working wirth form is easier because is simler built an interface with the VS form tool.

    Cheers.
    kaennon

  6. #6
    Join Date
    Jul 2003
    Location
    Olympia Washington
    Posts
    1
    I've been struggling with the same BUG and prefer not to convert all of my forms into controls.

    Here's the work around I finally came up with.


    Control maskCtrl = new Control();
    maskCtrl.Parent = this;
    maskCtrl.Dock = DockStyle.Fill;
    yourForm.Show();
    maskCtrl.Hide();


    Control maskCtrl is being used to mask Form yourForm until it has completed it's redrawing nonsense.

    It's still a hack, but kaennon may find it slightly more 'eligant' and it allows one to use forms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured