Hi,
Is there a way to change a single line of text, making half, one color and the other half a different color in bold?
Number of files (150) (150)
Printable View
Hi,
Is there a way to change a single line of text, making half, one color and the other half a different color in bold?
Number of files (150) (150)
Not in a text box. But in a Rich Text Box you can.
Im not sure how, but im sure someone will get the
code for ya =)
I am trying to make my treeview act like Outlook, Displaying items not read in bold surrounded by brackets.
I'm sure you can take this code, and expand it to meet your needs. This little snippet simply changes the color of one word, but the principle for what you wish to do remains the same.VB Code:
Private Sub Command1_Click() Dim strWord As String Dim lPos As Long strWord = "Hello" lPos = InStr(1, RichTextBox1.Text, strWord, vbTextCompare) If lPos > 0 Then With RichTextBox1 .SelStart = lPos - 1 .SelLength = Len(strWord) .SelColor = vbRed .SelStart = Len(RichTextBox1.Text) End With End If
Sorry. I submitted the post before I saw your second post specifiying a TreeView control.
I dont think you can do this with the treeview control. I posted the same question a while ago, and nobody had any ideas. The only thing you can do in the treeview is format the entire node text with simple things like bold and underline.