Author Topic: FormChangeButton bug  (Read 926 times)

fvandal

  • Newbie
  • *
  • Posts: 9
    • View Profile
FormChangeButton bug
« on: March 21, 2017, 02:10:55 PM »
Hello again!

i started to use the FormChangeButton with a panel PC for my job.
The screen that i have develop have a couple of those button
When i switch rapidly between different button the UI just die...
the process is still running in the background but the UI is just not available
My guess is that when the form change, there is a time that the screen can be click and the solution just dont know how to handle the info
The problem put a real hole in my programmation since my screen is not 100% foolproof

I already tried to put a timer or a sleep when the form is loaded. sadly, there is no real event to when the form is loaded
even shown only pop one time
activated is before the form is visible
new and load are way before any visible form

Can you help me?
Have a good day!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: FormChangeButton bug
« Reply #1 on: March 21, 2017, 03:35:50 PM »
The FormChangeButton uses a short timer (200ms) between showing and hiding forms to prevent a momentary blank screen. If you click a FormChangeButton within that time delay, it can cause all forms to hide. You can try to reduce the timer:

- In Solution Explorer under the the AdvancedHMI project, expand down the \FormChangeControls folder
- Right click FormChangeButton.vb and select View Code
- Go to line 102 where you will see ht.Interval = 200
- Change the 200 to 20
- Rebuild the solution

fvandal

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: FormChangeButton bug
« Reply #2 on: March 21, 2017, 04:23:25 PM »
I have made some test and that kind of fix the problem
if you keep hitting two button, the UI will fail eventually
i was wondering if a solution offer by Godra on another post, to use Tab Control, would be better for my application
there is a lot of graphic present in one of the page and that page take 5 secondes to load
i dont know if the Tab Control would fix this or if i needed to work a little bit to load all the page in a loading
Anyway thank you for the solution Archie

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: FormChangeButton bug
« Reply #3 on: March 21, 2017, 04:37:52 PM »
The MainMenu driven application avoids this problem by havng a small form always showing. That form is only used for the navigation buttons. You can see more about it here:

http://advancedhmi.com/forum/index.php?topic=1549.0