Author Topic: How to place a form on top of the mainform  (Read 1255 times)

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
How to place a form on top of the mainform
« 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 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5272
    • View Profile
    • AdvancedHMI
Re: How to place a form on top of the mainform
« Reply #1 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

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: How to place a form on top of the mainform
« Reply #2 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   

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5272
    • View Profile
    • AdvancedHMI
Re: How to place a form on top of the mainform
« Reply #3 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?

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: How to place a form on top of the mainform
« Reply #4 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.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5272
    • View Profile
    • AdvancedHMI
Re: How to place a form on top of the mainform
« Reply #5 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()

Holmux

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: How to place a form on top of the mainform
« Reply #6 on: September 08, 2018, 01:59:07 PM »
Hi Archie

Thanks, I got it working.

/Holmux