Hint color font and form

Posted on 2001-06-14
Last Modified: 2013-12-02

 I have this :
Procedure TForm1.MyShowHint(Var HintStr  : String ;
                            Var CanShow  : Boolean ;
                            Var HintInfo : THintInfo) ;
Var i : Integer ;
  For i := 0 To Application.ComponentCount - 1 Do
    If Application.Components[i] Is THintWindow Then
      With THintWindow(Application.Components[i]) Do
          Canvas.Font.Name   := 'Courrier' ;
          Canvas.Font.Size   := 12 ;
          Canvas.Font.Style  := [fsBold] ;
          HintInfo.HintColor := clAqua ;
        End ;
End ;

I work great.  But now I want to change the font's color.
But Canvas.Font.Color = ... do not work.  Why ?
And I want the hint window  with a different form (ellipse, round, bitmap, etc.). How can I do that ?

Thank you very much.

Question by:frdep
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

ITugay earned 200 total points
ID: 6195058
Hi frdep,

>>But Canvas.Font.Color = ... do not work.  Why ?

look at this:

procedure THintWindow.Paint;
  R: TRect;
  R := ClientRect;
  Inc(R.Left, 2);
  Inc(R.Top, 2);
//!!!!!!!!!!!!!!! how you like it ????????????
  Canvas.Font.Color := clInfoText;
  DrawText(Canvas.Handle, PChar(Caption), -1, R, DT_LEFT or DT_NOPREFIX or
    DT_WORDBREAK or DrawTextBiDiModeFlagsReadingOnly);

clInfoText defined as: clInfoText = TColor(COLOR_INFOTEXT or $80000000);
to change hint color you should change COLOR_INFOTEXT. Sample bellow set red font color for hints.

  I: Integer;
  A: array[0..2] of byte;

  A[0] := 255; // red value
  A[1] := 0; // green value
  A[2] := 0; // blue value
  SetSysColors(1, I, A);

>> And I want the hint window  with a different form (ellipse, round, bitmap, etc.). How can I do that ?

I think that you have to write your own hint window. Seems no other way to do so.

LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6196380

  Take a look for some hint components, free with source code at torry site

Expert Comment

ID: 6196837
go to: 
They have the best components of this kind

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month4 days, 12 hours left to enroll

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question