Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-09

Why is OnShow not executed?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

frans

Hi

I'm using Lazarus 1.6.4 on Windows. I have a Form with a TPageControl with 5 tabsheet components.
Every tab has his own OnShow procedure to set the latest data in the fields. Every time the Form is shown I want the first tab to become visible. Therefore the FormShow calls tab0.Show.
The first time the form shows it goes as I expect, the tab0 OnShow procedure is called and the data is set.
But when I close the form while showing the tab0, and then later opens it again, the FormShow is executed but tab0 OnShow is not. Apparently the program 'sees' that tab0 is already shown, so executing tab0.Show is not necessary. Is this as it should be?
To always execute the tab0 OnShow procedure I must call this directly. Is this the correct way?

mvg Frans van Leeuwen M 06-51695390 --- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com

Reply by email

Vojtěch Čihák

Hi,
just tested, it is same in Delphi7. Refresh data manually in FormShow is one of correct ways.  
V.
______________________________________________________________

Show quoted text 5 lines
Od: frans via Lazarus Komu: Datum: 28.09.2017 12:20 Předmět: [Lazarus] Why is OnShow not executed?

Hi

I'm using Lazarus 1.6.4 on Windows. I have a Form with a TPageControl with 5 tabsheet components.
Every tab has his own OnShow procedure to set the latest data in the fields. Every time the Form is shown I want the first tab to become visible. Therefore the FormShow calls tab0.Show.
The first time the form shows it goes as I expect, the tab0 OnShow procedure is called and the data is set.
But when I close the form while showing the tab0, and then later opens it again, the FormShow is executed but tab0 OnShow is not. Apparently the program 'sees' that tab0 is already shown, so executing tab0.Show is not necessary. Is this as it should be?
To always execute the tab0 OnShow procedure I must call this directly. Is this the correct way?

mvg Frans van Leeuwen M 06-51695390 --- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com <http://www.avg.com> --

Reply by email