Quercus Posted January 14, 2004 Posted January 14, 2004 How do I maximize a MDI child form programatically with no borders? I have an MDI form with a panel control and a splitter control docked to the left edge. I want to fill the remaining space with a child form, but I want the child form to be borderless. There will only be one child form at a time, but there are many possible child forms that could be displayed. The following code works just fine: CurrentPage = new frmHomePage(); CurrentPage.MdiParent = this; // CurrentPage.WindowState = FormWindowState.Maximized; CurrentPage.FormBorderStyle = FormBorderStyle.None; CurrentPage.Show(); However, if I uncomment the WindowState line, then when the form shows, it will be maximized, but the border is showing. I suppose I could just set the top, height, width and left properties of the form, but I was hoping to avoid the hastle. Any thoughts? Thanks. Quote
*Gurus* divil Posted January 14, 2004 *Gurus* Posted January 14, 2004 My thoughts would be to not use MDI at all. If there will only be one form showing at one time, don't use a form - use a control instead and just add it to your first form. It'll be cleaner, faster, and save resources. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Quercus Posted January 16, 2004 Author Posted January 16, 2004 I want to use forms because, although I will only have one form at a time, I have a dozen different forms that may be shown - and some forms are fairly complicated. It seems to me cleaner to do this with different forms than to have several different panels that I'm hiding and showing. Anyway, instead of maximizing, I'm setting the child form's Dock to Fill, and this seems to be working well. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.