Displaying XML in ie form

  • Thread starter Thread starter Cheryl
  • Start date Start date
C

Cheryl

Can anyone tell me where I can find information or examples on how to
create an instance of the WebBrowser control and display the XML in
there so that it is nicely formatted, using C#.
 
Cheryl,

It's actually quite easy. XML that does not have a stylesheet of its
own will be displayed by IE using a regular stylesheet (the one you are used
to with the color coding and the expandable nodes). Because of this, all
you have to do is get the WebControl in your toolbox. You can easily do
this by right clicking on the toolbox, and selecting the WebBrowser control
from the Active X tab on the dialog that comes up.

Then, in your program, you can call the Navigate or Navigate2 method to
have the control load the content from a temp file (which is the easiest way
to do it now).

Hope this helps.
 
Back
Top