 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Juergen Langer Guest
|
Posted: Sat Mar 26, 2005 10:55 pm Post subject: TProgressBar,TLabel,TEdit etc. shows the current position or |
|
|
Hi,
when I move the mouse cursor over a object and let it there e.g. over a
TProgressBar, Label, or other component, how can I shows the current value
(the position or value of the object is change continual below the mouse
cursor) on a hint?
Thanks for your help.
Juergen
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Sun Mar 27, 2005 9:12 am Post subject: Re: TProgressBar,TLabel,TEdit etc. shows the current positio |
|
|
If I understoud well, you should learn about THintWindow
class. This is the sample code. Place one TLabel on the form,
increase the font size.
As you can see, I used the event OnLeave() for detecting when
the hint should be dismissed, which for other controls has to be
implemented manually.
--- H ---
// ...
THintWindow *FHintWindow;
__fastcall ~TForm1();
// ...
--- CPP ---
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
FHintWindow = new THintWindow(this);
FHintWindow->Color=clInfoBk;
Label1->Width = 200;
Label1->Height = 200;
Label1->AutoSize = false;
}
__fastcall TForm1::~TForm1()
{
FHintWindow->ReleaseHandle();
delete FHintWindow;
}
void __fastcall TForm1::Label1MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y)
{
AnsiString T = IntToStr( X ) + ", " + IntToStr( Y );
TRect R = FHintWindow->CalcHintRect( Screen->Width, T, NULL );
OffsetRect( &R, X + Left + Label1->Left, Y+Top+Label1->Top );
FHintWindow->ActivateHint( R, T );
}
void __fastcall TForm1::Label1MouseLeave(TObject *Sender)
{
FHintWindow->ReleaseHandle();
}
--
Best regards,
Vladimir Stefanovic
"Juergen Langer" <juergen-langer (AT) web (DOT) de> wrote
| Quote: | Hi,
when I move the mouse cursor over a object and let it there e.g. over a
TProgressBar, Label, or other component, how can I shows the current value
(the position or value of the object is change continual below the mouse
cursor) on a hint?
Thanks for your help.
Juergen
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|