Board index » delphi » tPageControl.onChanging -- what is new page index?

tPageControl.onChanging -- what is new page index?

Hi all,

I'd like to be able to prevent a tPageControl from changing to certain pages
using the onChanging event. For my logic to work, I'll need to know the
index of the new (not current) page.

Does anyone know how to discover the index of the page to which a
pageControl is changing, during the onChange event?

Thanks,

Scott

 

Re:tPageControl.onChanging -- what is new page index?


Quote
> I'd like to be able to prevent a tPageControl from changing to certain pages
> using the onChanging event. For my logic to work, I'll need to know the
> index of the new (not current) page.

> Does anyone know how to discover the index of the page to which a
> pageControl is changing, during the onChange event?

There is no simple way to determine which page will become active in
OnChanging. You can try to do it this way:

 - in OnChanging store the current ActivePage into a form field
 - in OnChange check the new ActivePage, if it is not of your liking,
   set it back to the stored old ActivePage.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads