By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

Custom text edit control - where to start?

P: n/a
I need to write my own custom text edit control.. but I'm not sure where to
start - I've never written a custom control... the features I want are
somewhat similar to the VS .Net text editor - text colouring, collapsible
regions etc... I haven't been able to find anything that could achieve that
which is free...

So what is the suggested starting point? Can I make some kind of control
that derives from a RichEdit box and write my own paint methods? Should I
build a completely custom user control? Any suggestions, or pointers to
example source code of similar controls would be appreciated!
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You cannot go beyond this control's functionality

http://www.freetextbox.com/

Tweak the source code as per your needs..

Sudhakar Sadasivuni[MVP]
http://weblogs.asp.net/ssadasivuni
http://www.mugh.net
"Nick Haines" wrote:
I need to write my own custom text edit control.. but I'm not sure where to
start - I've never written a custom control... the features I want are
somewhat similar to the VS .Net text editor - text colouring, collapsible
regions etc... I haven't been able to find anything that could achieve that
which is free...

So what is the suggested starting point? Can I make some kind of control
that derives from a RichEdit box and write my own paint methods? Should I
build a completely custom user control? Any suggestions, or pointers to
example source code of similar controls would be appreciated!

Nov 16 '05 #2

P: n/a
It's not that simple to write a text editor like VS.

Basically, you'll have to implement your very own text buffer and position
tracking system. This should also be able to break big blobs of text into
manageable chunks/entities like lines, words, etc.

You could do all that or you can over-ride RichTextBox and do some clever
tricks with KeyDown/KeyPress and TextChanged events to parse the word which
is currently being edited and set its color, etc. But you'll soon find out
this is not a very good approach..

-vJ

"Nick Haines" <nh> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I need to write my own custom text edit control.. but I'm not sure where to start - I've never written a custom control... the features I want are
somewhat similar to the VS .Net text editor - text colouring, collapsible
regions etc... I haven't been able to find anything that could achieve that which is free...

So what is the suggested starting point? Can I make some kind of control
that derives from a RichEdit box and write my own paint methods? Should I
build a completely custom user control? Any suggestions, or pointers to
example source code of similar controls would be appreciated!

Nov 16 '05 #3

P: n/a
You might want to check out SharpDevelop. It's an open source IDE
written in C#. You might be able to glean some information from looking
at how their editor component is implemented.

http://www.icsharpcode.net/OpenSource/SD/

The book they advertise on their site provides some good explanations of
how the code works, including an extended discussion of different
approaches to writing text editors. I spent an afternoon reading through
it at Borders and found it quite interesting.

-Jason

Nick Haines wrote:
I need to write my own custom text edit control.. but I'm not sure where to
start - I've never written a custom control... the features I want are
somewhat similar to the VS .Net text editor - text colouring, collapsible
regions etc... I haven't been able to find anything that could achieve that
which is free...

So what is the suggested starting point? Can I make some kind of control
that derives from a RichEdit box and write my own paint methods? Should I
build a completely custom user control? Any suggestions, or pointers to
example source code of similar controls would be appreciated!

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.