This project is read-only.

Some sample code for XML highlighting please?

Topics: Developer Forum, User Forum
Jun 16, 2011 at 3:15 AM


I don't need a lot of features for my application - all I need is a C# TextBox that shows XML in different indents and colors like what Visual Studio does. If possible can someone please post a couple of lines of source code to show me how? This way I can avoid spending 8 hours browsing through the two hundred classes in the help file.

 wonder why doesn't the administrator of this web site post some sample code. People jump on adopting a tool when he sees a few lines of sample code that can do exactly what he wants. No one wants to spend 8 hours reading through a 50-page documentation just to find whether this tool can do his job.

Jun 16, 2011 at 5:36 PM

All you should have to do is set the language of the ScintillaNet text box to xml.  
This should be all you have to call after you setup the rest of it the way you want it.

Scintilla.ConfigurationManager.Language = "xml";

ScintillaNet will do the rest for you.

Jun 17, 2011 at 2:15 AM

I wonder this too... Perhaps a top level tab should be added to the project called "Documentation" with a help topic titled "How do I get syntax highlighting to work?" directly off the main documentation page.

Jun 17, 2011 at 11:24 PM

Hi Chris,

Have a look at a web site selling SFTP component:

This is what I meant. One click from Google, you seen straight a few lines of sample code. "Just what I want!" That's how I spent $500 to buy it. Cause not everyone is as smart as you are. Your attitude takes your business to nowhere.

Jul 13, 2011 at 7:04 PM

I managed to get a basic ScintillaNET based XML editor control working in Visual Studio.  I have blogged some instructions for that here, as a "hello world" style guide to getting started with ScintillaNET.  I hope it helps you out: