Board index » cppbuilder » Font dropdown

Font dropdown


2007-05-14 08:20:21 PM
cppbuilder67
How can I fill a owner-drawn dropdown with
all the font names? The font name
should be written in that particular font,
like in MS Office font dropdown.
Is any readymade VSL control available?
 
 

Re:Font dropdown

JEDI VCL has one of these
HTH Pete
"Ranganath" < XXXX@XXXXX.COM >wrote in message
Quote

How can I fill a owner-drawn dropdown with
all the font names? The font name
should be written in that particular font,
like in MS Office font dropdown.
Is any readymade VSL control available?
 

Re:Font dropdown

"Ranganath" < XXXX@XXXXX.COM >wrote in message
Quote

How can I fill a owner-drawn dropdown with
all the font names? The font name
should be written in that particular font,
like in MS Office font dropdown.
Is any readymade VSL control available?
You can use a standard owner-drawn TComboBox for that. For example:
__fastcall TForm1::TForm1(TComponent *Owner)
: TForm(Owner)
{
ComboBox1->Items->Assign(Screen->Fonts);
}
void __fastcall TForm1::ComboBox1DrawItem(TWinControl* Control,
int Index, const TRect &Rect, TOwnerDrawState State)
{
AnsiString s = ComboBox1->Items->Strings[Index];
ComboBox1->Canvas->FillRect(Rect);
ComboBox1->Canvas->Font->Name = s;
ComboBox1->Canvas->TextRect(Rect, Rect.Left, Rect.Top, s);
}
Gambit
 

{smallsort}