Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...