|
-
Nov 24th, 2008, 01:35 PM
#3
Thread Starter
Addicted Member
Re: Changing Fonts at Runtime ?
 Originally Posted by kleinma
Code:
'make sure selection is made in combo
if tscb_font.selectedindex = -1 then return
'set selectedtext to given font
rtb_text.SelectionFont = new font(tscb_font.text, put size here)
This will work, however it is unclear if you are looking to change the ENTIRE text of the RTB when you select a new font, or just the selected text. Just like Word, but unlike Notepad, the RTB can handle different fonts on text inside it. If you wanted to change the entire font of all the text when you change the selection, then just assign the font to the RTBs Font property instead of its SelectionFont property.
You also need to specify a size you want the font to be. If you want to use the existing size of the existing font, you could do something like
Code:
rtb_text.SelectionFont = new font(tscb_font.text, SelectionFont.Size)
Ok thx works perfect =)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|