In a Delphi 10.4 VCL Application, TCard
(as container-item of TCardPanel
) does not have public OnShow
and OnHide
events (like TTabSheet
has).
Therefore, the TCard.OnEnter
event-handler is NOT triggered when a specific TCard
is ACTIVATED. The TCard.OnEnter
event-handler is triggered ONLY when e.g. clicking on a control on the TCard
.
Example code:
CardPanel1.ActiveCard := Card2;
In this case, the TCard.OnEnter
event is NOT triggered!
Is it possible to upgrade the TCard
class with public OnShow
and OnHide
events? Or is it possible to simulate those events?
PrevCard.Name
orNextCard.Name
as string in that event-handler to identify the card then I get a run-time error. Now, I could useNextCard.Caption
to identify the card, but that leads to "Code-Smell", as the captions could change at runtime. The CLEANEST solution would be upgrading to aTCard.OnShow
event. - user1580348ActiveCard
? - Olivierif NextCart = Card1
or `if PrevCard = Card2' or whatever makes sense here. Hard to give advice without knowing the actual use case. - Uwe Raabe