Feb 16, 2002 #1 Blobishthing Programmer Joined Feb 16, 2002 Messages 23 Location 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
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
Feb 16, 2002 #2 footpad Programmer Joined Nov 9, 2000 Messages 1,086 Location US 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 Upvote 0 Downvote
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