Board index » delphi » Is there a way to show a control's hint explicitly

Is there a way to show a control's hint explicitly

Hi, I have a TreeView and I want to display a different hint depending on the node the mouse's over.

So on the MouseMove event of me TreeView, I wrote the code that changes the Hint value of my TreeView. This works fine. The only problem is that if the user moves his mouse while hint is displayed, I change the Hint property, but the hint displayed on the screen doesn't refresh, and the user has to move his mouse out and back of the TreeView for the correct Hint to display.

So I'm looking for a way to explicitly call a kind of "ShowHint" method or something like that that would redisplay the hint with the value I just setted.

Thanks in advance

Martin L'Heureux

PS : I'm using D5

 

Re:Is there a way to show a control's hint explicitly


THintWindow is the/a component (maintained by TControl/TApplication) to
display hints.

There are a few methods that could be helpfull for your purpose.
FHintWindow is the protected variable for your application, maby
you should use that.

Kind Regards,

Peter van Wijhe

"Martin L'Heureux" <martin.lheur...@americas.bnpparibas.com> schreef in
bericht news:3ca340ad$1_2@dnews...

Quote

> Hi, I have a TreeView and I want to display a different hint depending on

the node the mouse's over.
Quote

> So on the MouseMove event of me TreeView, I wrote the code that changes

the Hint value of my TreeView. This works fine. The only problem is that if
the user moves his mouse while hint is displayed, I change the Hint
property, but the hint displayed on the screen doesn't refresh, and the user
has to move his mouse out and back of the TreeView for the correct Hint to
display.
Quote

> So I'm looking for a way to explicitly call a kind of "ShowHint" method or

something like that that would redisplay the hint with the value I just
setted.
Quote

> Thanks in advance

> Martin L'Heureux

> PS : I'm using D5

Re:Is there a way to show a control's hint explicitly


In your handler, you can try:

  mycontrol.ShowHint := false;
  mycontrol.Hint := 'My text';
  mycontrol.ShowHint := true;

Make sure you use the control ShowHint, not the Apllication ShowHint.

This still relies on the user moving the mouse to a new position in the control window to
activate the hint

Quote
"Martin L'Heureux" <martin.lheur...@americas.bnpparibas.com> wrote in message

news:3ca340ad$1_2@dnews...
Quote

> Hi, I have a TreeView and I want to display a different hint depending on the node the
mouse's over.

> So on the MouseMove event of me TreeView, I wrote the code that changes the Hint value

of my TreeView. This works fine. The only problem is that if the user moves his mouse
while hint is displayed, I change the Hint property, but the hint displayed on the screen
doesn't refresh, and the user has to move his mouse out and back of the TreeView for the
correct Hint to display.
Quote

> So I'm looking for a way to explicitly call a kind of "ShowHint" method or something

like that that would redisplay the hint with the value I just setted.
Quote

> Thanks in advance

> Martin L'Heureux

> PS : I'm using D5

Re:Is there a way to show a control's hint explicitly


ElPack has a very powerful mouse hint control that Eugene produced for me.

It gives you more control than you can find anywhere else.

Eugene is truly a master programmer!

Raymond Kennington

Quote
Martin L'Heureux wrote:

Other Threads