Color,Bolden,etc any word's of your choice in a RichTextBox
Color,Bolden,etc any word's of your choice in a RichTextBox
Rate Color,Bolden,etc any word's of your choice in a RichTextBox
(2(2 Vote))
Public Function ColorWord(RTF As RichTextBox, Swords As String, Scolor As ColorConstants, _
SFontsize As Integer, Sbold As Boolean, Sitalic As Boolean, Sbullet As Boolean)
search = 1
Do Until search = 0
search = InStr(search, RTF.Text, Swords, vbTextCompare)
If search > 0 Then
With RTF
.SelStart = search - 1
.SelLength = Len(Swords)
.SelColor = Scolor
.SelFontSize = SFontsize
.SelBold = Sbold
.SelItalic = Sitalic
.SelBullet = Sbullet
End With
search = search + Len(Swords)
End If
Loop
With RTF
.SelStart = Len(RTF.Text)
.SelColor = vbBlack
.SelFontSize = 8
.SelBold = False
.SelItalic = False
.SelBullet = False
End With
End Function
'********CALL THE FUNCTION FROM YOUR FORM LIKE THIS********
ColorWord rtb, "blue", vbBlue, 10, True, False, False
***********************************************************
Color,Bolden,etc any word's of your choice in a RichTextBox Comments
No comments yet — be the first to post one!
Post a Comment