简体   繁体   中英

XML text Editor - Text Box

I would like to design one xml text editor which is based on normal text-box which implements all XML characteristics(ie, it should implement intelligence to differentiate the text colors by node_name,attribute_name,attribute_value and it should check proper closing the tag).

Can any one give me the idea how I could process the each and every character entered by the user(normally we can call the TextBox1_TextChanged event after fully entered the text in text-box but I need to call this event each and every character entry)? I am good in C#, so that I have decided to transform the control to coding page because I already did one editor using console application which read the input character from the user and change the text color.

I might be wrong to approach this problem like this way so, give your suggestions, valuable reference links and ideas to accomplish this editor.

If you know any plugins to do this task please inform me

Thanks in Advance.

Regards,

--SJ

Use a Rich Text Box and handle the KeyDown event for character processing.

Rich Text Box will allow you to do syntax highlighting, text formatting, etc.

I would also validate entered xml for correctness and possibly highlight incorrect syntax to the user if validation fails.

All this is going to required effort, i am not aware of any QUICK solution. But using the basics i've suggested here, you could achieve what you require if you put in the effort.

The EditArea appears to have the features (and more) that you are looking for.

You could also check the list of Javascript base source code editors

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM