I want to create a class in which I typed the text between "" then the text color get changed.
and also yes, I want to change the text color for some words.
Yes it is somewhat similar like the Script Editor.
Can anyone help me with this?

4 Years
Discussion Span
Last Post by Deep Modi

You will need to based your new class on a richtextbox to allow different formating within the text. You will also need to overwrite the ToString to parse the input and format the text accordingly


OK you'll need to do something like this:

Public Class MyFomattedTextbox
    Inherits System.Windows.Form.RichTextbox

    Public Overrides Function ToString()
        'parse the text inside the richtextbox
        'if you find " " then format the text between each one      
       dim i, x as integers
       i =instr(me.Text, chr(34))
       while i <> 0
           'got first " - find the next
           y = (i, me.text, chr(34))
           if y = 0 then
               exit while
               'format the string between i and y
               i = y + 1
           end if
           if i > len(me.text) then
               exit while
           end if
       end while
    End Function

End Class

oops, i can't understand whether y is string or integer.
and I thing I make some mistake in your coding.
can you explain with the example.
here is an example coding that I try.
and the first some comment line describe about the problem or that I want to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.