TTabControl/TPageControl.OnChange is not called on first page addition
Original Reporter info from Mantis: Simon Ameis @SAmeis
-
Reporter name: Simon Ameis
Original Reporter info from Mantis: Simon Ameis @SAmeis
- Reporter name: Simon Ameis
Description:
If a new tab is assigned to an empty TTabControl, the OnChange event is not called despite the TabIndex property changes from -1 to 0.
Steps to reproduce:
Place a TTabControl and a button on a form. The tab control may not have any tabs.
In the button's OnClick event place the code
i := TabControl1.Tabs.Add('abc'); TabControl1.TabIndex := i;
to add some pages.
Also assign some test code (e.g. ShowMessage) to the TabControl's OnClick event for monitoring.
When first clicked, the OnChange event is not called (because TabIndex has already been changed to 0 on tab addition). On each subsequent click, the OnChange event is called.
Mantis conversion info:
- Mantis ID: 27324
- OS: Windows 8.1, 64bit
- OS Build: 8.1
- Build: 47402 (1.5)
- Version: 1.3 (SVN)