0

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?

2
Contributors
4
Replies
17
Views
3 Years
Discussion Span
Last Post by Deep Modi
0

Hi
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

0

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
           else
               '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
0

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.
attachment:

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.