Solved

Hint color font and form

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

Hi,
 I have this :
Procedure TForm1.MyShowHint(Var HintStr  : String ;
                            Var CanShow  : Boolean ;
                            Var HintInfo : THintInfo) ;
Var i : Integer ;
Begin
  For i := 0 To Application.ComponentCount - 1 Do
    If Application.Components[i] Is THintWindow Then
      With THintWindow(Application.Components[i]) Do
        Begin
          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.

0
Comment
Question by:frdep
3 Comments
 
LVL 9

Accepted Solution

by:
ITugay earned 200 total points
ID: 6195058
Hi frdep,

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

look at this:

procedure THintWindow.Paint;
var
  R: TRect;
begin
  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);
end;

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.

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

begin
  A[0] := 255; // red value
  A[1] := 0; // green value
  A[2] := 0; // blue value
  I := COLOR_INFOTEXT;
  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.

-----
Igor.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6196380
Hello

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

http://www.torry.net/hints.htm
0
 
LVL 3

Expert Comment

by:f15iaf
ID: 6196837
go to:
www.tmssoftware.com 
They have the best components of this kind
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now