AdvancedHMI Software

General Category => Support Questions => Topic started by: Holmux on September 08, 2018, 09:18:42 AM

Title: How to place a form on top of the mainform
Post by: Holmux on September 08, 2018, 09:18:42 AM
Dear Forum

I am very new to the AdvancedHMI setup and Visual for that matter, so this newbie level questions :) 

My plan was to use the mainform and place a row of 7 buttons in the bottom of the form, from these
buttons I would like to call forms that will lay on top of the mainform, all the forms I call will be shorter
then the mainform, so the buttons always are visable.

But when I call a form on top, it is positioned to the left of the mainform, how do i change this so they are
positioned from the left top corner of the mainform ??

I have tried all combinations in the layout section but haven't found the solution,

Please advice

/Holmux 
Title: Re: How to place a form on top of the mainform
Post by: Archie on September 08, 2018, 09:26:41 AM
It sounds like you want to create a "Main menu driven" application. Check this post to see if it is what you want to do:


https://www.advancedhmi.com/forum/index.php?topic=1549.msg8337#msg8337
Title: Re: How to place a form on top of the mainform
Post by: Holmux on September 08, 2018, 11:07:05 AM
Thanks Archie

I have tried going that route as well, just place the menu in the bottom and the forms on top, I would have like to have the menu in full size and the forms on top
but I haven't worked out how to place anything over parts of the menu, is this possible ?

I would like to leave stuff like Exit buttons and out system setup variables on the menu behind the forms, so when I close the forms I am left with system setup.

This is just how I would normally do this in the SCADA systems I use to work with, maybe this is not the right approach in Visual and I need to take another route.

/Holmux   
Title: Re: How to place a form on top of the mainform
Post by: Archie on September 08, 2018, 11:29:51 AM
Are you looking to do an MDI (multi document interface), which is the old style that things like Microsoft Word used to use? It has a main frame, then multiple child forms contained within that frame?
Title: Re: How to place a form on top of the mainform
Post by: Holmux on September 08, 2018, 11:43:14 AM
I have looked into this as well, but being a newbie I am struggling with a simple thing like calling the child form with a button, if I use the MainMenuButton, I can't choose
the childform from the list, but it would work if I just figure out haw to call them without using the menu.
Title: Re: How to place a form on top of the mainform
Post by: Archie on September 08, 2018, 11:52:00 AM
From the All Windows Forms group in the Toolbox, Add a Button
Double click the button to get back to the code
Enter this code:
  Form2.Show()
Title: Re: How to place a form on top of the mainform
Post by: Holmux on September 08, 2018, 01:59:07 PM
Hi Archie

Thanks, I got it working.

/Holmux