Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Boxes

Status
Not open for further replies.

Blobishthing

Programmer
Feb 16, 2002
23
AU
i am making a text editor but i cant work out how to make a list box change the fonts. please help!
Thanx in advanced
 
The easiest way to do this is to drop a TFontDialog on your form and then create a trigger for doing something like this:

Code:
   with FontDialog1 do
      if execute then
         RichEdit1.SelAttributes.assign( Font );

This affects the selected text in the rich edit, which is closer to what most people want.

You can also set the font of the rich edit directly:

Code:
   with FontDialog1 do
      if execute then
         RichEdit1.Font := Font;

But that's usually not what your users want. Still, it is useful for setting defaults.

Take a look at the Help example for TTextAttributes for more granular control.

Hope this helps...

-- Lance

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top