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;
I think this works:
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.