Avoid click propagation on Page that is under the current page on a TPageControl

118 views Asked by At

I have a TPageControl that contains five pages and the page shown is alternated setting the ActivePageIndex property in this way:

PageControl1.ActivePageIndex := 4;

the problem is that the page below covered by the page currently shown get click on his buttons while the mouse is pressed on the above page, how can I avoid this behaviour ? How can I avoid the propagation of the click on Pages below the currently shown (that is also the current index)?

The application uses CLX as Graphics library instead of VCL.

1

There are 1 answers

0
Yevgeniy Afanasyev On

Delphi does not do click Propagation.

I would check if the button that gets click are placed on the TabSheet and not on the parent control. Find the button you want in the drop down list of object inspector and press - the selected item will be the parent of the button. Is it a TabSheet?

Or you can add this code as a first line of your button-click-function

ShowMessage(TButton(Sender).Parent.Name);