|
-
Mar 8th, 2000, 03:51 AM
#1
Thread Starter
Frenzied Member
How can i change the font and fontsize in a RichTextBox???
-
Mar 8th, 2000, 04:01 AM
#2
Use the SelFontName and SelFontSize Properties after selecting the Text you want to alter with the SelStart and SelLength Properties.
-
Mar 8th, 2000, 04:02 AM
#3
Addicted Member
RichEdit1.selfontname = "Times New Roman"
RichEdit1.selfontsize = 10
If you want all the font of the entire box to be the same do
'Highlight all text
RichEdit1.SelStart = 1
RichEdit1.selLength = len(RichEdit.Text)
'Set font properties
RichEdit1.SelFontName = "Times New Roman"
RichEdit1.SelFontSize = 10
'UnSelect all text
RichEdit1.SelLength = 0
-
Mar 8th, 2000, 04:05 AM
#4
Check out SelFontName. Try this. Add a RichTextBox and a ListBox to your form:
Code:
Private Sub Form_Load()
Dim i As Integer
For i = 0 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(i)
Next
End Sub
Private Sub List1_Click()
RichTextBox1.SelFontName = List1.List(List1.ListIndex)
End Sub
Selecting the FontName in the ListBox will change the font in the RichTextBox.
-
Mar 8th, 2000, 04:06 AM
#5
Wow, 3 replies in 4 min...
-
Mar 8th, 2000, 05:24 AM
#6
Thread Starter
Frenzied Member
Thanks guys!
Thanks for the quick replies!!! : o )))
Edited by CyberCarsten on 03-08-2000 at 05:25 PM
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
|