I searched for a control that would allow me to make a color editor for my custom keywords. I developed an RDBMS program called Store (I will post it later) and I allowed a user to enter a SQL query (look at the picture below) at run time so I needed a control to color SQL keywords. However, I didn't find something to help me in C# MSDN, so I search the Web and I found it 'CodeMax.ocx' control. It's a fantastic control that allows you to specify the keywords you want and it colors it for you.
Using the Code
You will find
CodeMax v2.0 in two forms (codemax20.ocx for Visual Basic, codemax20.dll for Visual C++). Get it and copy to 'C:\windows\system32\' and then type this command run dialog '
regsvr32 codemax20.ocx'. You will get a message telling you that com has been registered.
Choose a new Windows control project . Add the
CodeMax control to the tools box, then pass it on your control and set the dock property to fill in the class constructor. Write the following code:
CodeMax.Globals Global=<CODE>new CodeMax.GlobalsClass();
CodeMax.Language lang=new CodeMax.LanguageClass();
Points of Interest
You also need to write some methods to
set properties to the control. After that, you will get a control which you can use in any .NET application without any problem.
Please read the documentation. You will find more properties like a property to get text from the control, get a line number, highlight specified line, and more.