Click here to Skip to main content
14,335,684 members

Write Your Customized Editor for Your Own Programming Language

Rate this:
3.15 (6 votes)
Please Sign up or sign in to vote.
3.15 (6 votes)
13 Jun 2004CPOL
An article on a customized editor for your own programming language
Sample Image -CodeMax Control


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.

Sample Image - from Store

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();
//unregister all languages specified with the control(like c++).
//define a new language
CodeMax.Language lang=new CodeMax.LanguageClass();
//specify if your language character is case sensitive
//enter all keywords separated by '\n'.
lang.Keywords="\n";//write your key words here separated by \n
lang.TerminatorChar=@";";//specify line terminator character
//choose a name for your language
//your language is now ready to use so 
//set properties to your control

Points of Interest

You also need to write some methods to get or 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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Taha Amin
Egypt Egypt
Senior Development Manager, with 11 years of experience. Focused on design/developing/delivery B/OSS modules to satisfy customer/business requirements in accordance to TM Forum's TAM/SID framework. Excellent communication and interpersonal skills, flexibility, ability to adjust to new people and situations, strong problem solving skills and willing to work effectively and efficiently. Gained additional leadership skills such as: - High effective mentorship and coaching - Clearly communication and solutions sharing with my team - Decision making

Comments and Discussions

GeneralHi ! I found the solution Pin
jaorsoftware4-Feb-11 3:30
memberjaorsoftware4-Feb-11 3:30 
GeneralHi ! Pin
jaorsoftware4-Feb-11 3:14
memberjaorsoftware4-Feb-11 3:14 
GeneralHelp to VB 6 Pin
jaorsoftware4-Feb-11 2:21
memberjaorsoftware4-Feb-11 2:21 
QuestionAd or contribute? Pin
afasano4-Jul-04 10:15
memberafasano4-Jul-04 10:15 
QuestionDetails...? Pin
ip2559-Jun-04 3:40
memberip2559-Jun-04 3:40 
Generalterrible article formatting Pin
nsimeonov7-Jun-04 15:28
membernsimeonov7-Jun-04 15:28 
GeneralMay I suggest... Pin
Marc Clifton29-May-04 2:05
protectorMarc Clifton29-May-04 2:05 
GeneralRe: May I suggest... Pin
je_gonzalez29-Apr-09 15:06
memberje_gonzalez29-Apr-09 15:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 27 May 2004


27 bookmarked