[Lazarus] RE : Multiple hints for a TStatusBar
ludo.brands at free.fr
Sat May 19 11:07:08 CEST 2012
> Please don't put significant thought into this, but does
> anybody have a
> reliable code fragment that will pop up a different hint from a
> multi-panel status bar, depending on which panel the mouse is over?
Create an OnMouseMove event handler for the status bar and use the following
procedure TForm1.StatusBar1MouseMove(Sender: TObject; Shift: TShiftState; X,
until (i=StatusBar1.Panels.Count) or (X<border);
This will show a hint 'Panel 1', 'Panel 2', etc. when you hover over the
different panels. Replace StatusBar1.Hint:='Panel '+IntToStr(i); with
whatever code to display the hint you like.
is needed to cancel and retrigger the hint whenever the mouse moves. The
Statusbar is one control and moving the mouse from one panel to another
without exiting the status bar wouldn't cancel and retrigger the hint.
Tested on windows.
More information about the Lazarus