Click here to Skip to main content
15,396,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I would like to design one xml text editor which is based on normal text-box which implements all XML characteristics.
1. 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.
2. I might be wrong to approach this problem like this way so, give your suggestions, valuable reference links and ideas to accomplish this editor.

Thanks in Advance

Updated 14-Apr-13 21:57pm
BillWoodruff 17-Apr-13 2:59am
Please add some more specifics about exactly what functionality your XML editor will provide

For example: how "smart" does your XML editor need to be: are you going to keep track of nesting levels, and monitor every character: so that if a user enters an extra close-angle-bracket that would render the XML invalid: are you going to catch that right away ... or are you going to scan the text contents for proper nesting closures only when the user triggers it, or the file is saved ?

This CodeProject article shows a complete XML editor (with color syntax highlighting); you can probably get some ideas from it:
codeninja-C# 17-Apr-13 3:49am
Hi BillWoodruff, I would like to design XML editor (same as Visual Studio 2008, while creating new XML file that window contain all the properties of XML) in web page. I also updated my question in

1 solution

For your 1st statement use KeyPress event, it will be triggered everytime you hit a key.

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
                MessageBox.Show("is digit");
codeninja-C# 17-Apr-13 3:52am
Hi, in text box i don't find "KeyPress" event. how could i achieve it?
Thomas Barbare 17-Apr-13 4:46am
Oh sorry, it's an ASP application... I thought it was windows form.
Do you really wants to do a postback everytime user type ? I think it will cost too much especially if a lot of user are typing at the same time. But if you want to do that consider using Javascript to call the postback with his keypress event.
Hope that help you
codeninja-C# 17-Apr-13 8:04am
Hi Thomas, Thanks. you can find my full requirement from following URL

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900