How would you make some words in a textbox bold and some not with VB5?
Printable View
How would you make some words in a textbox bold and some not with VB5?
you may have to use richText box control
Ramdas
Try working with this code:
Hope that helps.Code:Private Sub Form_Load ()
With RichTextBox1
.Text = "Welcome to the RichTextBox Sample Source Code!"
.SelStart = 0
.SelLength = Len(.Text)
.SelFontName = "Arial"
.SelFontSize = 10
.SelAlignment = rtfCenter
.SelStart = InStr(.Text, "RichTextBox") - 1
.SelLength = Len("RichTextBox")
.SelFontName = "Courier New"
.SelColor = vbBlue
.SelStart = InStr(.Text, "Sample Source Code") - 1
.SelLength = 4
.SelFontName = "Courier New"
.SelUnderline = True
.SelStart = .SelStart + 1
.SelLength = 1
.SelColor = vbRed
.SelStart = .SelStart + 1
.SelLength = 1
.SelColor = vbBlue
.SelStart = .SelStart + 1
.SelLength = 1
.SelColor = vbGreen
.SelStart = 0
.SelLength = 0
End With
End Sub