EDN Admin
Well-known member
Hi,
I am writing a GUI to edit a XML document. There are a few custom validation rules, which, if violated, will spit out error messages. I want to list all the error messages below the XML content which is hosted in a
TextBox , just like Visual Studio lists compiling errors below C# source code, and, when double-clicking the error message, I want the corresponding XML element to be highlighted in the
TextBox , just like what Visual Studio does.
This means that
<ol>
Each error message should be linked to the corresponding XmlElement
(or XElement ) - this is fairly easy; From each XmlElement , I should be able to find out its text location in the
XmlDocument (i.e. the TextBox ), so that I can call the
TextBox s Select method to highlight the element. How can I do that?
</ol>
Thank you in advance!
View the full article
I am writing a GUI to edit a XML document. There are a few custom validation rules, which, if violated, will spit out error messages. I want to list all the error messages below the XML content which is hosted in a
TextBox , just like Visual Studio lists compiling errors below C# source code, and, when double-clicking the error message, I want the corresponding XML element to be highlighted in the
TextBox , just like what Visual Studio does.
This means that
<ol>
Each error message should be linked to the corresponding XmlElement
(or XElement ) - this is fairly easy; From each XmlElement , I should be able to find out its text location in the
XmlDocument (i.e. the TextBox ), so that I can call the
TextBox s Select method to highlight the element. How can I do that?
</ol>
Thank you in advance!
View the full article