|
-
Sep 12th, 2000, 05:18 PM
#1
Thread Starter
Lively Member
how do i know if selected text, i.e. rtf.seltext, contains two or more font types such as two different font names or two different font size?
-
Sep 12th, 2000, 06:54 PM
#2
_______
<?>
I could be wrong on this but I thought that the rtf just takes the last font selection and that is the selection for the whole box.
ie> everything is bold and NewRoman 12
Code:
Private Sub Form_Load()
With RichTextBox1
.Text = "line one" & vbCrLf
.Font = "courier"
.Font.Size = "14"
.Text = .Text & "line two" & vbCrLf
.Font = "New Roman"
.Font.Size = 12
.Font.Bold = True
.Text = .Text & "line three"
End With
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 12th, 2000, 07:03 PM
#3
This will detect the text's font in the RichTextBox:
Code:
Private Sub Command1_Click()
If RichTextBox1.SelText <> "" Then
Msgbox RichTextBox.SelFontName
End If
End Sub
If you want to extract the contents of the RichTextBox:
Code:
Private Sub Command1_Click()
If RichTextBox1.SelText <> "" Then
Msgbox RichTextBox.SelRTF
End If
End Sub
-
Sep 13th, 2000, 01:48 PM
#4
Thread Starter
Lively Member
I wasn't really asking for what you guys had in mind... but it's ok, I figured how to do it by errorhandling.. thans anywayz
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
|