Hiding Text in RichTextBox

S

sravan_reddy001

Hi,

I'm trying to create an Editor. I have a requirement that certain text
in the RTB should be hided, i.e., the text in the RTB should represent
like a treeview control. Just like we have in visual studio where we
can hide the code for a particular method or block of code.

I have an idea. Using the TreeView Control. but this control doesn't
support RichText.

To hide/unhide the text the operations will be similar to that of
treeview Control (+/-) symbols to unhide/hide the grouped text.

I want all the properties of RTB and the TreeView hiding(or grouping)
in the application that work together.

(this is similar to the one used in many advanced editor like VS and
notepad++)

Thanks in advance
 
S

sravan_reddy001

Peter said:
[...]
To hide/unhide the text the operations will be similar to that of
treeview Control (+/-) symbols to unhide/hide the grouped text.

I want all the properties of RTB and the TreeView hiding(or grouping)
in the application that work together.

If I recall correctly, you can provide your own drawing for items in the
TreeView. Depending on how complex your rich-text is, you might find it
suitable to just explicitly draw the text yourself (using
Graphics.DrawString() or TextRenderer.DrawText(), for example).

I also have a vague memory that the unmanaged rich-text control API
provides a way to have the rich-text drawn into an arbitrary target
(device context). It's possible you could leverage that to handle the
actual rendering, along with the above to take advantage of the TreeView
behavior.

Pete



Does that mean, I've to use the graphics object to create what I need
in the application.
There are some additional things in the editor that might restrict
this Graphics or TextRenderer Funcionalities.

I need the line count and will need to change the font regularly. And
also intellisense feature is available which will require more complex
text Processing.

Can that all be done using the these graphics objects?

I've another doubt regarding RTB in WPF, I'll post that in anothre
thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top