943,802 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 36816
  • C# RSS
May 11th, 2005
-1

Display a html file on a form

Expand Post »
I need a control to put on a window form to show a web page from a url.
Is there such a control in the .net framework.

Thanks
Similar Threads
yda
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yda is offline Offline
3 posts
since May 2005
Jun 15th, 2005
0

Re: Display a html file on a form

Hi,
yeah, you can use the "webBrowser" component. If you don't have this component in your toolbox, just click on the empty place on your toolbox with right mouse button, then "Choose items" and choose the "webBrowser" component. That's how it is in Visual Studio 2005, but I think it'll be quite similar in VS .net, too.

Example:

webBrowser1.Navigate("www.microsoft.com");
Reputation Points: 10
Solved Threads: 0
Light Poster
Stivi is offline Offline
26 posts
since Jun 2005
Jun 16th, 2005
0

Re: Display a html file on a form

Just a note, the webbrowser control is in fact an ecapsulation of the Internet Explorer browser. This allows you to do some unique things. For example, the html you display could contain hyperlinks, and you can overload the Navigate event. So when a user clicks a hyperlink, instead of navigating, you can do whatever you like.

One application I wrote was to display PDF phone statements, with live hyperlinks (I used PostScript and pdfMark programming to create the PDFs w/ hyperlinks).

The PDF was displayed in a web browser control on a windows form. When the call center operator clicked on a given line in the statement, the code captured that event and link to run a query, popping up the call details in a new window.

This let the phone company use the PDF of the exact statement the customer recieved, as an interface back to call data.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Jun 18th, 2005
0

Re: Display a html file on a form

Thanks but if Im using VS.NET 2003
what can I do ?
yda
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yda is offline Offline
3 posts
since May 2005
Jun 25th, 2005
0

Re: Display a html file on a form

Use can use Web Broser control in VS.NET 2003 too,
Right click on Toolbox, select Customize, select COM Components tab, look for Microsoft Web Browser.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tiendq is offline Offline
2 posts
since Jun 2005
Jun 25th, 2005
0

Re: Display a html file on a form

Thanks Rhats great !!
yda
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yda is offline Offline
3 posts
since May 2005
Jun 6th, 2010
0
Re: Display a html file on a form
I'm using webBrowser in VS.NET 2003 but I donn't understand: It read html from Database --> display?
Now,I read html from Database after I write file (ex: index.html --> webBrowser1.Navigate("index.html"); ) but windows 7 don't support write.
who have otherwise? Help me...
Thank you very much
Last edited by ttvnth; Jun 6th, 2010 at 9:58 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ttvnth is offline Offline
2 posts
since Jun 2010
Jun 6th, 2010
0
Re: Display a html file on a form
Help me...
Last edited by ttvnth; Jun 6th, 2010 at 9:57 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ttvnth is offline Offline
2 posts
since Jun 2010
Jun 7th, 2010
0
Re: Display a html file on a form
Navigate is used with Uris, use this instead:

C# Syntax (Toggle Plain Text)
  1. string html = "<html><body><strong>HelloWorld!</strong></body></html>";
  2. Browser.DocumentText = html;
Reputation Points: 65
Solved Threads: 30
Junior Poster
PierlucSS is offline Offline
187 posts
since Feb 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Localization - Language Translation
Next Thread in C# Forum Timeline: Cut text and apply image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC