Another form issue with MainMenu

M

Marty

Hi,

I have this issue where a form that contain a
System.windows.forms.mainmenu has its height increased by the height of
the mainmenu at object creation level.

Here's the idea:

//form creation
frmMyForm myForm = new frmMyForm();

//frmMyForm constructor
public frmMyForm() : base()
{
InitializeComponent();
this.Width = 200;
this.Height = 200;
this.Show();
}
//Then the form has its height = this.Height + this.MainMenu.height;


//But if I show the form before setting the height, then the form get
//its correct height = 200.
//frmMyForm constructor
public frmMyForm() : base()
{
InitializeComponent();
this.Show();
this.Width = 200;
this.Height = 200;
this.Show();
}

Do you have an idea?

Thank you
Marty
 
M

Marty

Hi,

I tried "this.size = new Size( 200, 200)" but the form is still
expanding. I just don't understand why and I have to make the form
visible before setting its width and height, that give an an annoying
visual effect.

Does anybody already got that case?

Thanks.
Marty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top