Recent

Author Topic: TPageControl OnChange  (Read 5268 times)

fakusz

  • Newbie
  • Posts: 1
TPageControl OnChange
« on: May 26, 2011, 10:09:27 am »
hello

I have Lazarus 0.9.30 under Windows 7
my program crashed that worked fine with Lazarus 0.9.28
the problem is, that I have a PageControl on a form and is attached a method to the OnChange event
in this event I call a procedure that enumerates the tab's child controls (TWinControl.ControlCount, TWinControl.Controls[])
the program is crashing at this point, because the OnChange event on the PageControl is executed before the form's OnCreate

I put a flag onto the form, that becomes true after the form's OnCreate and I check the value of this flag in the PageControl's OnChange
so now the program is working, but I think this is not normal

regards,
fakusz

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TPageControl OnChange
« Reply #1 on: May 26, 2011, 01:04:53 pm »
Quote
because the OnChange event on the PageControl is executed before the form's OnCreate
Are you sure of this ? I seems it is a bug.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zeljko

  • Hero Member
  • *****
  • Posts: 1764
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TPageControl OnChange
« Reply #2 on: May 26, 2011, 10:03:59 pm »
Are you sure of this ? I seems it is a bug.

hm...now I'm wondering how it's possible that OnChage of TPageControl is executed before form is created ...

 

TinyPortal © 2005-2018