-
May 6th, 2003, 01:01 PM
#1
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
-
May 6th, 2003, 02:42 PM
#2
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
-
June 13th, 2003, 11:16 AM
#3
Better solution
Hi
Is there a more elegant solution?
Thanks
kaennon
-
June 13th, 2003, 11:47 AM
#4
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
-
June 13th, 2003, 02:34 PM
#5
MDI Form
Hi,
but working wirth form is easier because is simler built an interface with the VS form tool.
Cheers.
kaennon
-
July 14th, 2003, 07:45 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|