Performance of actions at cursor induction on a component
The author: OlegGG
The initial link: - - -
To fulfill any actions at cursor induction on a visual component, it is necessary to define the handler of event OnMouseEnter of this component.
The following code changes text color of element Label1 on dark blue at induction for it of the mouse cursor:
void __ fastcall TForm1:: OnLabel1MouseEnter (TObject * Sender) {
Label1-> Font-> Color = clBlue;
}
And to fulfill some actions when the cursor abandons a control item, it is necessary to define the handler OnMouseLeave
The following code changes text color of element Label1 on black while the mouse cursor abandons it: void __ fastcall TForm1:: OnLabel1MouseEnter (TObject * Sender) {
Label1-> Font-> Color = clBlack;
}