Help needed for a complete beginner

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Karl Grambow
Avatar
Hi,

I've been looking around for a syntax highlighter for T-SQL for use within a vb.net windows application so I downloaded an evaluation version of SyntaxEditor but to be honest I'm completely overwhelmed and I have no idea where to start.

The documentation seems to be aimed at a more advanced user (although admittedly I am a complete beginner).

All I want to do is have a richtextbox (or syntaxeditor) control on my form and to be able to write T-SQL code which is highlighted as text is typed into the control or pasted in.

Can you give me some pointers as to how to start. I thought it would be quite simple with the SyntaxEditor control but maybe I was wrong. Not that there's anything wrong with the control. Quite the opposite, it's extremely impressive. I just need to be shown the right direction hopefully.

Thanks

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Karl,

To get started, just place an instance of SyntaxEditor on your form. Say you call the variable instance of the control "editor". Then do a line like this:
editor.Document.LoadLanguageFromXml(path);
Where "path" contains the path to the SQL language definition we provide in the Languages folder of the C# sample project. After you do those two things, you'll have T-SQL highlighting active.

After that you use the various methods/properties of the editor.Document object to manipulate text. SyntaxEditor supports multiple "views" on the same document. By default one is open and can be obtained via editor.SelectedView. Each view has its own selection data, which can be obtained from the editor.SelectedView.Selection object.

Hope that helps!


Actipro Software Support

Posted 14 years ago by Karl Grambow
Avatar
Thanks for the quick reply.

Turns out it was very simple :). I needed to supply an encryption key as well as the path. I just supplied a value of 0 for that and it worked. Is there anything important about the encryption key that I should know?

Anyway, thanks again. I can now get on with having a look at the various properties and such.

Just one more question. Is the XML file considered to be source code as far as the licensing of the product is concerned? The reason I ask is because I want to know if there is any provision within the scope of the standard license (not the blueprint license) to edit the XML file (say I want to use a different color for some keywords). This isn't really a big deal to be honest, but I was just curious.

Thanks
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Since the XML files are clear text we provide the encryption mechanism (you did it right by using a zero for none) to encrypt your definitions for distribution with your applications.

We freely provide the XML language definitions for you to modify and use in your apps.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.