Results 1 to 5 of 5
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    [Help]Change Txt Colors[Solved]

    How can you make it so that users can change the colour of the highlighted text of richtextbox.

    Basically users will highlight specific text in richtextbox and click on a button to open a colour dialogue.

    Then that selected text will be the colour of the colour dialogue colour.

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by ppl2pass View Post
    How can you make it so that users can change the colour of the highlighted text of richtextbox.

    Basically users will highlight specific text in richtextbox and click on a button to open a colour dialogue.

    Then that selected text will be the colour of the colour dialogue colour.
    Drag 1 button, 1 colordialog component and a richtextbox to form.

    Now double click the button and add the following:

    Code:
    If Not ColorDialog1.ShowDialog = Windows.Forms.DialogResult.Cancel Then
                RichTextBox1.SelectionColor = ColorDialog1.Color
    
    
            End If
    If you want to change the back color of the selected text it is also possible and also font can be changed. And there are other functions too....Just play with them a bit and you'll master it. An example:

    Code:
     If Not ColorDialog1.ShowDialog = Windows.Forms.DialogResult.Cancel Then
                RichTextBox1.SelectionColor = ColorDialog1.Color
                RichTextBox1.SelectionFont = New Font("Verdana", 10, FontStyle.Bold)
                RichTextBox1.SelectionBackColor = Color.LightBlue
                RichTextBox1.SelectionBullet = True
                RichTextBox1.SelectionIndent = 30
    
    
            End If
    Hope this helps

  3. The Following User Says Thank You to Hassan For This Useful Post:

    ppl2pass (05-09-2010)

  4. #3
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    tyvm. +rep.

  5. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by ppl2pass View Post
    tyvm. +rep.
    No problem dude. Any time

  6. #5
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    Mark Solved please

Similar Threads

  1. [Help] Changing Richtextbox's selection color. [solved]
    By alvaritos in forum Visual Basic Programming
    Replies: 5
    Last Post: 04-22-2011, 03:19 AM
  2. [Help]Changing text values[Solved]
    By master131 in forum Visual Basic Programming
    Replies: 4
    Last Post: 10-13-2010, 07:38 AM
  3. [Help]Change Button Text[Solved]
    By [PA]nts in forum Visual Basic Programming
    Replies: 7
    Last Post: 06-29-2010, 02:48 PM
  4. [Help]Changing X,Y[Solved]
    By dylan40 in forum Visual Basic Programming
    Replies: 6
    Last Post: 03-24-2010, 04:56 PM
  5. [Help]Form Background Color[Solved]
    By Shark23 in forum Visual Basic Programming
    Replies: 5
    Last Post: 03-08-2010, 10:34 PM