Author Topic: Application stays open with no visible forms  (Read 1234 times)

jclay06

  • Newbie
  • *
  • Posts: 2
    • View Profile
Application stays open with no visible forms
« on: February 26, 2014, 01:48:12 PM »
First of all, I'm astounded by the ability of the this software you've put together for free.

I'm having a problem when there are multiple pages/forms.
A "Main" form will have FormChangeButtons linking to other forms. The "Main" form goes to "not visible" as it seems, and the requested form is brought up. If you happen to close this new form with the windows 'X', the application is still running, but no forms are visible. Only method of closing it is to open up task manager and kill it manually.

I can't seem to find any properties on the FormChangeButton or the WindowsForm items that will do something to the effect of OnFormClose() kill task. Will I need to manually add some function call like that to each page? Only one form will be visible at any given time, but unless it's what AdvancedHMI thinks is the "Main" form, it doesn't kill the task on it's own. Meaning currently, you would have to navigate back to the "Main" form and only then will clicking the 'X' actually close the program.

Maybe I've overlooked something.

Thanks for all the work you've put in to this.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Application stays open with no visible forms
« Reply #1 on: February 26, 2014, 02:12:13 PM »
The design of the FormChangeButton is to always use them to navigate between the forms and make all the forms borderless so they cannot be closed.

There are multiple ways around this if you want your secondary forms to have a sizable border with a close button (X). One is to not use the FormChangeButton, but to use a standard windows button and in the click event, just show the second form without hiding the first form.

The other is to put a handler for the FormClosing event on the second form, and in that code, show the MainForm.