Windows Vista Forums

Need to programmatically color words in text editor
  1. #1


    Dave M. Guest

    Need to programmatically color words in text editor

    I want to create an application with program script editor that supports
    syntax color highlighting similar to the Visual Studio editor.
    I need a way for me to tell the text editing control to change the color of
    a number of characters of text at a particular character position.



    What is the best way to go about doing this in WPF?
    I looked at the TextBox and it doesn't appear to support this.
    I took a quick look at the RichTextBox and I don't see any way to do it
    easily with this control either.
    Should I create my own control derived from TextBoxBase?
    Thanks for any help you can give

      My System SpecsSystem Spec

  2. #2


    llester Guest

    RE: Need to programmatically color words in text editor

    use TextRange.ApplyPropertyValue(Inline.BackgroundProperty, Brushes.Yellow);

    "Dave M." wrote:

    > I want to create an application with program script editor that supports
    > syntax color highlighting similar to the Visual Studio editor.
    > I need a way for me to tell the text editing control to change the color of
    > a number of characters of text at a particular character position.
    >
    > What is the best way to go about doing this in WPF?
    > I looked at the TextBox and it doesn't appear to support this.
    > I took a quick look at the RichTextBox and I don't see any way to do it
    > easily with this control either.
    > Should I create my own control derived from TextBoxBase?
    > Thanks for any help you can give


      My System SpecsSystem Spec

Need to programmatically color words in text editor problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text editor that doesn't need an install martin j Vista General 3 06 Nov 2009
text editor Michael Soza PowerShell 4 11 Jul 2009
Is there a way to programmatically display a collection editor? opellegr .NET General 2 09 Mar 2009
Text Editor/ Debugger IDE? quantumscript VB Script 1 19 Aug 2008
Words change- similar to T-9 text mswg DW Vista General 5 04 Mar 2008