views:

715

answers:

2

I'm making heavy use of PropertySheets in my application framework's configuration editor. I like them a lot because it's pretty easy to work with them (once you learn how) and make the editing bulletproof.

One of the things that I'm storing in my configuration are Python scripts. It's possible to edit a Python script in a StringCollection editor, which is what I've been using, but there's a long distance between "possible" and "useable." I'd like to have an editor that actually supported resizeable and monospace fonts, preserved blank lines, and - hey, let's go crazy with the wishlist - did syntax coloring.

I can certainly write this if I really have to, but I'd prefer not to.

I've poked around on the Google and can't find anything like what I'm describing, so I thought I'd ask here. Is this a solved problem? Has anyone out there already taken a crack at building a better editor?

+1  A: 

You would need to write your own type editor. You can think of this as a user control, in that when you write your own type editor you are providing the UI controls that appear when the property grid edits the property. As such, you can create a type editor that does anything, which means if you have a third-party editor control you can include it as part of type editor.

Some resources to get you started:

Scott Dorman
Scott can you add some links to helpful resources which explain your approach? It would improve your answer quite a bit and lead to some upvotes I think.
spoon16
A: 

Here is an article that could prove to be a starting point: article 1

Or this one: article 2

dviljoen