Results 1 to 3 of 3

Thread: reset richtextbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    reset richtextbox

    How do you reset a RichTextBox? I wrote some code that changes the RichTextBox1.SelectionColor = Color.White and RichTextBox1.SelectionBackColor = Color.Red. I'd like to change all the text in the RichTextBox back to Black and no back color.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,371

    Re: reset richtextbox

    Like this:
    Code:
    Dim i As Integer = RichTextBox1.SelectionStart
            RichTextBox1.SelectAll()
            RichTextBox1.SelectionColor = Color.Black
            RichTextBox1.SelectionBackColor = Me.BackColor 'Or White
            RichTextBox1.BackColor = Me.BackColor 'Or White
            RichTextBox1.SelectionStart = i
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2011
    Posts
    184

    Re: reset richtextbox

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width