Author Topic: multiforms closing problem  (Read 1174 times)

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
multiforms closing problem
« on: May 08, 2017, 07:02:30 AM »
hello

in my hmi project
i have 6 pages

the first one is the main

it has 5 buttons each button opens a form

what i do is the other five forms have close button that closes them and return to the main page

the button code is

Code: [Select]
Me.Hide()
            mainpage.Show()
.

now when i run the application

i can go to tow pages
when i try to open a third page it gives me runtime error

so i need to close them not hide them

but when i try the code

Code: [Select]
Me.close()
            mainpage.Show()

or

Code: [Select]
Me.close()
           

 it gives an error too

so what is the best way to open the forms and close them


the open form code i use  is


Code: [Select]
page1.show()
with thanks

Phrog30

  • Guest
Re: multiforms closing problem
« Reply #1 on: May 08, 2017, 07:40:22 AM »
Use the open form button Archie made. That's the best/easiest.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #2 on: May 08, 2017, 09:45:22 AM »
the thing is am using multi panels each panel works as a thumbnail for its page

not buttons

so when i double click on the panel it opens its page
something like cameras software

Phrog30

  • Guest
Re: multiforms closing problem
« Reply #3 on: May 08, 2017, 11:07:36 AM »
Ok, regardless of what you use the code should be similar, if not the same.  Open Archies button and look at the code and use that.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #4 on: May 08, 2017, 12:32:15 PM »
this is archie code

Code: [Select]
f1.Show()
                f1.BringToFront()

it would give the same problem


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: multiforms closing problem
« Reply #5 on: May 08, 2017, 03:57:53 PM »
Post more details in the error you are getting.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #6 on: May 08, 2017, 04:45:46 PM »
I will get them tommorow and post them here

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #7 on: May 09, 2017, 07:12:45 AM »
the error comes as like this

i click to open the form it opens good
then i return to the main page

after that if i try to open any form

it gives the error in the attachments



oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #8 on: May 09, 2017, 07:17:42 AM »
note : all my forms are the same
the only thing is deferrent is the plc address and the form name
so they have the  same components and controls with the same name

could that be the problem?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: multiforms closing problem
« Reply #9 on: May 09, 2017, 07:33:47 AM »
Click the View Details and look for the first class and line number in the list which should be near the top.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: multiforms closing problem
« Reply #10 on: May 09, 2017, 07:52:01 AM »
I REMOVED THE IMAGELIST FROM ALL THE FORMS THEN I TRIED TO OPEN AND CLOSE FORMS AND IT WORKS FINE

SO AM GONNA PUT NEW LIST MABYE THE PROBLEM WAS IN COPYING THE PROMS AND JUST CHANGING THE FORM NAME