I'd like to display some HTML code in a form using the axwebbrowser control,
without having to create a temporary file to navigate to. I'm trying the
following code (let's say that the web browser control is named wbb):
object o = System.Reflecti on.Missing.Valu e;
wbb.Navigate("a bout:blank", ref o, ref o, ref o, ref o);
while (wbb == null) Application.DoE vents();
mshtml.HTMLDocu ment doc = (mshtml.HTMLDoc ument)wbb.Docum ent;
doc.body.innerH TML = "...(my html code)...";
here the last line of code throws an exception as doc.body is null, even if
I have forced the control to navigate to the blank page to avoid this.
What's the correct way of setting the HTML code of a webbrowser control?
Thanks guys! 2 1833
Try to write the code in DocumentComplet e Event
Nirosh.
"Dan" <df***@hotmail. com> wrote in message
news:O8******** ******@TK2MSFTN GP10.phx.gbl... I'd like to display some HTML code in a form using the axwebbrowser
control, without having to create a temporary file to navigate to. I'm trying the following code (let's say that the web browser control is named wbb):
object o = System.Reflecti on.Missing.Valu e; wbb.Navigate("a bout:blank", ref o, ref o, ref o, ref o); while (wbb == null) Application.DoE vents(); mshtml.HTMLDocu ment doc = (mshtml.HTMLDoc ument)wbb.Docum ent; doc.body.innerH TML = "...(my html code)...";
here the last line of code throws an exception as doc.body is null, even
if I have forced the control to navigate to the blank page to avoid this. What's the correct way of setting the HTML code of a webbrowser control?
Thanks guys!
Hi Dan, I'd like to display some HTML code in a form using the axwebbrowser control, without having to create a temporary file to navigate to. I'm trying the following code (let's say that the web browser control is named wbb):
object o = System.Reflecti on.Missing.Valu e; wbb.Navigate("a bout:blank", ref o, ref o, ref o, ref o); while (wbb == null) Application.DoE vents();
wbb is never "null". Use wbb.Document or see Nirosh's answer.
bye
Rob This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: panik |
last post by:
Hi,
retreiving the source code from an instance of the AxWebBrowser component,
using getBody(), through an IHTMLDocument2 object, makes the sourcode look
very bad:
All tags are in uppercase, all attributes are unquoted. Despite the fact
that the sourcecode that was input into the browser component had lowercase
HTML tags and quoted...
|
by: Michael C |
last post by:
Anyone know of a good HTML Rendering control? I need a control that will
render and display HTML in a Windows form. It doesn't need to pull down
HTML pages from the Web - I'll feed it all the HTML it needs to display.
I've already spent way too much time trying to get the Microsoft WebBrowser
control to work, and I have too many other things...
|
by: thompson_38 |
last post by:
What is the difference between calling a HTML page stored on the local
machine (axWebBrowser.Navigate("home.htm" ref 0, ref 0, ref 0, ref
0)) and being able to access a frame, to creating a resource DLL with
all the HTML pages then calling
axWebBrowser.Navigate("res://mydll.dll/home.htm" ref 0, ref 0, ref
0, ref 0)) and not being able to...
|
by: thompson_38 |
last post by:
What is the difference between calling a HTML page stored on the local
machine (axWebBrowser.Navigate("home.htm" ref 0, ref 0, ref 0, ref
0)) and being able to access a frame, to creating a resource DLL with
all the HTML pages then calling
axWebBrowser.Navigate("res://mydll.dll/home.htm" ref 0, ref 0, ref
0, ref 0)) and not being able to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
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...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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...
| |