473,545 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to display a web page (in windows application) from an html string ?

Hi,

i have some html string and i would like to display it like the web browser
does.

what is the best way to do it ?

Best Regards ,

Tiraman :-)
Nov 20 '05 #1
6 3573
* "Tiraman" <ti*****@netvis ion.net.il> scripsit:
i have some html string and i would like to display it like the web browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #2
Thanks!

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:eG******** *****@tk2msftng p13.phx.gbl...
* "Tiraman" <ti*****@netvis ion.net.il> scripsit:
i have some html string and i would like to display it like the web browser does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 20 '05 #3
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display
any methods.

Me.myBrowser.Na vigate2("about: blank")
Me.myBrowser.Do cument.Write("< HTML><BODY>HELL O WORLD</BODY></HTML>")
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:eG******** *****@tk2msftng p13.phx.gbl...
* "Tiraman" <ti*****@netvis ion.net.il> scripsit:
i have some html string and i would like to display it like the web
browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 20 '05 #4
Cool!

"Jared" <VB***********@ email.com> wrote in message
news:10******** *****@corp.supe rnews.com...
You don't even have to save it to disk if you navigate to a blank document
first.
Use the WebBrowser control as Herfried suggested except browse to
about:blank first. Then use the document.Write moehod of the webbrowser
control to add your html string. Don't worry if intellisense doesn't display any methods.

Me.myBrowser.Na vigate2("about: blank")
Me.myBrowser.Do cument.Write("< HTML><BODY>HELL O WORLD</BODY></HTML>")
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:eG******** *****@tk2msftng p13.phx.gbl...
* "Tiraman" <ti*****@netvis ion.net.il> scripsit:
i have some html string and i would like to display it like the web
browser
does.


Save it to disk and use the webbrowser control to load the file
('Navigate2' method):

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic .NET
<URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 20 '05 #5
Hi.

I just found this post while having a similar problem. This solution
works for me also, *if I can also set the LocationURL property*. This is
because my string may have references to relative paths (for example
<form action="/someurl">). The hyperlink won't work unless the location
is the right one, or I make a method to replace all the relative paths
for absolute ones. Any suggestions?

TIA,
Manuel Ricca

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #6

You can use the html BASE tag with absolute path, and all other links
can stay relative.

Atara.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3163
by: lkrubner | last post by:
I'd like to write a PHP script to be used from the command line on a Unix machine. I'd like for the script to put together a string, turn it into a web page, print it, then return control the command line. Obviously it is quite easy to make a string that is valid HTML and send it to the printer. The tough part is making look like a web page....
5
4040
by: Mullin Yu | last post by:
i want to build an application of both gui and batch interface by using windows application project. i check either passing any args or not. if no, then open the gui application. if yes, use the batch interface. my problem is that i can output the string to the dos prompt when running the exe file at dos prompt: c:\>test.exe /?
20
5602
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
5
25831
by: James P. | last post by:
Hello, For my new Windows application, all I want is to create an initial form to demo to the user to show them how it looks like with some data on it. So I figure the fastest way is to create some comboBox-es to show some data on them manually entered in the code without connecting to the database yet. It should be simple but somehow I...
1
6767
by: dave | last post by:
I want to design/develop an windows application (C#) that can query multiple websites (XmlHttpRequest), call number of 3rd party external webservices (SOAP) and parse/process the data and display it to the user. Ideally this would have been developed as a website, but due to crosss doman limitation on XmlHttpRequest, I am thinking of...
3
2872
by: Just D. | last post by:
All, What's the simplest way to show my own HTML string on the ASPX page assuming that this page is just created using the wizard and it has nothing on it? We're free to use any control adding it to this page just to show this HTML string. I know that in some cases we can use .InnerHtml property of some controls to inject the HTML string...
3
3860
by: C#Schroeder | last post by:
I am new to creating a windows application and have been asked to display an HTML page when a certain button is clicked. I have created the HTML page but don't know how to display it when the button on the windows application is pressed. Can anyone point me in the right direction. Thanks
2
4470
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My...
1
4836
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.