RichTextBox Colors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SeasCommander
    New Member
    • Sep 2007
    • 8

    #1

    RichTextBox Colors

    When I append data to my richtextbox I use selectioncolor to set the color of that block of text. The problem with this, is if the user is selecting as well.


    If my sub is called, the following executes:

    with myrichtextbox
    .selectioncolor = mycolor
    .appendtext(myt ext)
    end with


    So you see the problem is if the sub is called while the user is also selecting text, mycolor is applied to the user's selected text instead of mytext. Any suggestions?
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Keep FormLevel Variables For the Selection which u do from Code. Pass the variables to the Procedure, and In Procedure, Remove any Previously Selcted Text and Again Re-Select That Part of Text (Passed thru parameter) and Apply Colors.

    REgards
    Veena

    Comment

    • SeasCommander
      New Member
      • Sep 2007
      • 8

      #3
      Thanks, you were very helpful in solving this problem!

      Comment

      Working...