Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET XML
Hi,
 
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
 
Regards,
--SJ
Posted 14-Apr-13 22:14pm
Edited 14-Apr-13 22:57pm
v2
Comments
BillWoodruff at 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: http://www.codeproject.com/Articles/70461/XML-Editor-Control
CodeNinja-C# at 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 asp.net web page. I also updated my question in
http://www.codeproject.com/Questions/578304/XMLplustextplusEditorplus-plusTextplusBox
--SJ

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if(char.IsDigit(e.KeyChar))
            {
                MessageBox.Show("is digit");
            }
        }
  Permalink  
Comments
CodeNinja-C# at 17-Apr-13 3:52am
   
Hi, in text box i don't find "KeyPress" event. how could i achieve it?
--SJ
Thomas Barbare at 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# at 17-Apr-13 8:04am
   
Hi Thomas, Thanks. you can find my full requirement from following URL
http://www.codeproject.com/Questions/578304/XMLplustextplusEditorplus-plusTextplusBox

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

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 240
2 DamithSL 200
3 Raul Iloc 185
4 Richard MacCutchan 175
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 17 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100