Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4019418
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:06:07+00:00 2026-05-20T10:06:07+00:00

How i can add some values to color Box in the TFontDialog? Or please

  • 0

How i can add some values to color Box in the TFontDialog?
Or please tell me about components that can select font with custom color?
I use Delphi 7.

Thanks.

I found some way… But how i can show TColorDialog when color box changed on itemIndex = 0?

 procedure TForm1.FontDialog1Show(Sender: TObject);
const
 IDCOLORCMB = $473;
 SMyColorName: PChar = 'clMoneyGreen';
 CMyColor: TColor = clMoneyGreen;
begin
 SendDlgItemMessage(FontDialog1.Handle, IDCOLORCMB, CB_INSERTSTRING, 0,
 Integer(SMyColorName));
 SendDlgItemMessage(FontDialog1.Handle, IDCOLORCMB, CB_SETITEMDATA, 0,
   ColorToRGB(CMyColor));
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:06:08+00:00Added an answer on May 20, 2026 at 10:06 am

    I think this works:

    interface
    
    TFontDialog = class(Dialogs.TFontDialog)
    const
      IDCOLORCMB = $473;
    protected
      procedure WndProc(var Message: TMessage); override;
      procedure DoShow; override;
    end;
    
    ...
    
    implementation
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      FontDialog1.Execute();
    end;
    
    { TFontDialog }
    
    procedure TFontDialog.DoShow;
    const
      SMyColorName: PChar = 'Custom...';
      CMyColor: TColor = $0033ccff;
    begin
      SendDlgItemMessage(Handle, IDCOLORCMB, CB_INSERTSTRING, 0, Integer(SMyColorName));
      SendDlgItemMessage(Handle, IDCOLORCMB, CB_SETITEMDATA, 0, ColorToRGB(CMyColor));
    end;
    
    procedure TFontDialog.WndProc(var Message: TMessage);
    begin
      inherited;
      with Message do
        if (Msg = WM_COMMAND) and (WParamHi = CBN_SELENDOK) and (WParamLo = IDCOLORCMB) and (SendDlgItemMessage(Handle, IDCOLORCMB, CB_GETCURSEL, 0, 0) = 0) then
          with TColorDialog.Create(Self) do
            try
              Color := TColor(SendDlgItemMessage(Self.Handle, IDCOLORCMB, CB_GETITEMDATA, 0, 0));
              Options := [cdFullOpen];
              if Execute(Self.Handle) then
                SendDlgItemMessage(Self.Handle, IDCOLORCMB, CB_SETITEMDATA, 0, ColorToRGB(Color));
            finally
              Free;
            end;
    end;
    

    But notice, as David correctly argues in the comments below, that this code might fail if the dialog box should change (significantly enough) in a future version of Windows. That might or might not be a showstopper for the OP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I add Java portlet in sharepoint 2007? If yes, can some please explain
How can i reset a display:none and add some value here is the code
I know I can add service behaviors with some XML configuration, but I'd like
Can I adjust the ASP.NET Membership Tables to add some columns of my own?
I have form, where some fields are looks like rows, so I can add/delete
For some reason I can't get this script to run when I add the
I have an application where the user can write up some questions and add
i am having an add to basket problem.Some products have options like color/size. I
I have a table with some data values. I would like to add styles
In my application, I have some color settings, font settings and a Dictionary containing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.