Windows Forms MainMenu question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have decided to use a MainMenu in my main form. I have a menu item
"Open Form". When this item is clicked I want the "newform.frm" to open just
below the menu in the main form. How can this be done? I am using VB.Net.

Thanks for any replies.

Yoshi
 
Yoshimitsy,

Just see where your OpenForm is on your main form. (The left is easy that is
the Left of that menu).

Than add that to the Top and the Left of your form and set before you open
your new form the Top and the Left to that.

Don't forget to set before the WindowsDefaultLocation to manual.

I hope this helps,

Cor
 
Hi Cor,
I had a similar (or maybe it is the same need) to open a form just
below the title and menu bars on my main form. I had to also take into
account the size of these bars by adding to the form load event


me.Topp = _
SystemInformation.CaptionHeight +
SystemInformation.MenuHeight +
SystemInformation.Border3dSize.Height

It seemed to work. Can you confirm this is the correct way to do it?

TIA,
John
 
Thanks for your reply. What code did you use in the click event of the Menu
Item?? What is the code to load the new form in the main form just below the
MainMenu?

Cheers,
Yoshi
 
yoshimitsu,

There are 3 types of forms in window forms Net

Normal forms, modal forms and Mdi forms.

From your writing I understand it can only be a normal form or a modal form.

A modal form, which is opened with showdialog is much easier to handle than
a normal form that you open as extra form.

A modal form is easier necause that when you open a modal form the user
cannot access the original form while he can with a normal form.

You choose for the last as everybody does in the beginning. However know
that that needs much more expirience to handle all those forms and keep the
information as it has to be.

Therefore give us some information what you want.

Cor
 
J L said:
Hi Cor,
I had a similar (or maybe it is the same need) to open a form just
below the title and menu bars on my main form. I had to also take into
account the size of these bars by adding to the form load event


me.Topp = _
SystemInformation.CaptionHeight +
SystemInformation.MenuHeight +
SystemInformation.Border3dSize.Height

It seemed to work. Can you confirm this is the correct way to do it?

TIA,
John

That would work fine depending upon the formborderstyle and the actual
height of the menu. The menubar will wrap as the form is resized, but of
course, this may not be an issue in your app.

I would use:
newForm.Top = Me.RectangleToScreen(Me.ClientRectangle).Top
 
Back
Top