VB.net Richbox Formatierung

08/16/2010 00:21 nag#1
Code:
RichTextBox1.Find(account, RichTextBoxFinds.MatchCase)
RichTextBox1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
RichTextBox1.SelectionColor = Color.Red
Dieser Makiert leider alles in der Richtexbox Wie mache ich das das das wort account makiert wird nicht mehr.
08/16/2010 01:01 Madd Eye#2
Code:
RichTextBox1.Find([COLOR="Red"]"[/COLOR]account[COLOR="Red"]"[/COLOR], RichTextBoxFinds.MatchCase)
ein simpler fehler xD
08/16/2010 11:10 nag#3
Nein xD Dies ist eine Variabel. Ich speichere darin beim Lesen einer Mysql tabelle Accountnamen. Selbst wenn ich einen Accountnamen, wie "nag" eingebe, funktioniert es nicht. (Nein es liegt nicht an den "")
08/16/2010 14:29 Demon-777#4
Kp ob das so geht aber versuch es mal so:

Code:
Private Sub SelectWithColor(ByRef rtf As RichTextBox,
                                ByVal textToSelect As String,
                                ByVal color As Color,
                                ByVal font As Font)

        Dim index = rtf.Find(textToSelect, RichTextBoxFinds.WholeWord)

        If index <> -1 Then
            ' Select our word.
            rtf.Select(index, Len(textToSelect))

            ' Select new font.
            rtf.SelectionFont = font

            ' Select color of selection.
            rtf.SelectionColor = color
        End If
    End Sub
Dann halt ganz einfach "SelectWithColor" aufrufen.

Code:
SelectWithColor(Me.RichTextBox1, account, Color.Red, New Font("Verdana", 12, FontStyle.Bold))
08/16/2010 15:01 nag#5
Danke aber ich hatte heute Morgen eine andere idee. habe alles in 2 Richboxen gemacht. Es geht doch in meinem Script. Trotzdem Danke-
03/22/2013 16:39 farmeeer3#6
xd
03/23/2013 11:05 Kraizy​#7
Quote:
Originally Posted by farmeeer3 View Post
xd
Was hast du bitte für Probleme in nem Thread von 2010 nen sinnlosen Beitrag abzugeben
03/23/2013 12:01 Graphicscore#8
Quote:
Originally Posted by Kraizy​ View Post
Was hast du bitte für Probleme in nem Thread von 2010 nen sinnlosen Beitrag abzugeben
LoL