hint

can someone give me some working examples of how the hint works please delphi 6,7.
966Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cebassoCommented:
i really don't know exactly what are you talking about...
anyway... for a normal hint, you just need to set the Hint property on the component with what you wanna show and the ShowHint property to True example
Hint := 'This is a hint';
ShowHint := True;
you can set at the Object Inspector
for the component show his parent Hint, set the property ParentShowHInt to True
i hope its what you are talking about hahahaha
0
Emmanuel PASQUIERFreelance Project ManagerCommented:
for each form, panel, control, etc... where you want a Hint buble to show up when leaving the mouse over it a few seconds, you have to do 2 things :
set the Hint property with the text you want
set the ShowHint property to true.

for the ShowHint property, it's possible to only set the ShowHint of the form, and by default all components you place on it have the ParentShowHint set to true, which means that their own ShowHint will take the value of the parent (ie the form). Much like the Font & ParentFont property
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

966Author Commented:
Thanks , can i change the colour and font of the hint box ?
0
966Author Commented:
If i use flat hint, how would i add code to show a hint instead.

procedure TForm1.FlatHint1ShowHint(var HintStr: String;
  var CanShow: Boolean; var HintInfo: THintInfo);
begin

end;
0
966Author Commented:
when i set it up as follows, ias soon as i "hover" over label 1, it displays the hint using my flat component. Im aware youdont have the component, but there are no options on this, the component just dispays a cool arror next to it. However, when i gover off from the label and back onto it again, it gives an error

" flathint1 is already used"

what code can i add to fix this, ive tried to free it, but nothing.

procedure TForm1.FlatHint1ShowHint(var HintStr: String;
  var CanShow: Boolean; var HintInfo: THintInfo);
begin
flathint1.Create(label1);
end;
0
966Author Commented:
yes after i cancel the error box it works fine .. :(
0
Emmanuel PASQUIERFreelance Project ManagerCommented:
To change the hint color, you can use SetSysColors (and GetSysColor to get the current values) with COLOR_INFOBK

http://www.delphi-zone.com/2010/02/how-to-get-set-system-colors/

MSDN Ref :
http://msdn.microsoft.com/en-us/library/ms724940%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/ms724371%28VS.85%29.aspx

procedure SetupHintColor(C:TColor);
Const
 Element: TColor = COLOR_INFOBK;
begin
 SetSysColors(1, Element, C);
end;

Open in new window

0
966Author Commented:
doesnt matter about flat hint, stay with the standard one i think. So again, how would i change background from grey ?
0
966Author Commented:
ah cool, i just typed that withought rfreshing, ill check it out now
0
966Author Commented:
So if i wanted background colour blue and text colour red, how would the code be?
0
Emmanuel PASQUIERFreelance Project ManagerCommented:
ok, what I told you before would change the Hint back Color for all application for this windows session.

here is how with Delphi you can change only your application Hint properties :
Application.hintpause:=20000; //set how long hint showed Application.hinthidepause:=0; //delay time before hint is hidden
Application.hintcolor:=clBlue; //hint back color Screen.hintfont.name:='times new roman'; //hint font type Screen.hintfont.color:=clRed; //hint font color 
Screen.hintfont.style:=[fsbold,fsitalic]; //hint style

Open in new window

0
Emmanuel PASQUIERFreelance Project ManagerCommented:
Sorry, that did not came out right (line return pb)
Application.hintpause:=20000; //set how long hint showed
Application.hinthidepause:=0; //delay time before hint is hidden
Application.hintcolor:=clBlue; //hint back color
Screen.hintfont.name:='times new roman'; //hint font type
Screen.hintfont.color:=clRed; //hint font color
Screen.hintfont.style:=[fsbold,fsitalic]; //hint style

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
966Author Commented:
great!
0
966Author Commented:
procedure SetupHintColor(C:TColor);
begin
Application.hintpause:=20000; //set how long hint showed
Application.hinthidepause:=0; //delay time before hint is hidden
Application.hintcolor:=clBlue; //hint back color
Screen.hintfont.name:='times new roman'; //hint font type
Screen.hintfont.color:=clRed; //hint font color
Screen.hintfont.style:=[fsbold,fsitalic]; //hint style
end;

? like this?
0
966Author Commented:
not sure how to set it out mate, the above i posted is wrong i just relised.
0
senadCommented:
:-)))  ???

Anyway,if you can get TMS components it has a nice message box that works
perfect for hints and is highly configurable....
0
Emmanuel PASQUIERFreelance Project ManagerCommented:
You don't use the C parameter of your function. I only provided all the things you could change about your Hint visual aspect and behaviour. just add these lines (not even all, only the one you need to change) and call this procedure in your application main form creation

procedure SetupHintColor;
begin
 Application.hintpause:=20000; //set how long hint showed
 Application.hinthidepause:=0; //delay time before hint is hidden
 Application.hintcolor:=clBlue; //hint back color
 Screen.hintfont.name:='times new roman'; //hint font type
 Screen.hintfont.color:=clRed; //hint font color
 Screen.hintfont.style:=[fsbold,fsitalic]; //hint style
end;

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Pascal

From novice to tech pro — start learning today.