Marc Weustink wrote:
Luiz Americo Pereira Camara wrote:
While working with a TNotebook with multiples pages i needed to set specific actions (open/close a dataset) for each page when is show/hide.

First i tried the OnEnter/OnExit events but it has two problems:
- The event is not fired after the Tab is clicked. Is necessary to click inside the page or in one of the subcomponents - The event can be fired more then once if you click inside a subcomponent and then in the page body.

The other option is to hook Notebook OnPageChanged and OnChanging events, identify each TPage and set the proper action. When working with few pages is fine but when there are more pages the code can become ugly.

???
Isn't pageindex set when both events are fired ?

in OnChanging check PageIndex for the page you leave, In OnPageChanged, check pageindex for the new page.

Ok. It's the second option i mentioned. I'll stay with that.
Marc.

BTW, I think the naming of both events are inconsistent. I would expect either OnChanging/OnChanged or OnPageChanging/OnPageChanged
Not a combination of both
Agree. I think OnPageChanging/OnPageChanged is better.

BTW: OnChanging is not published.


Luiz

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to