I am using a web browser control to display some PPT slides saved as HTML. My
client has recently asked that the background of the browser be changed to
sonething other than white so that the slides "standout". I've tried setting
the browser's BackColor setting, but that had no effect at run time. Any
suggestions on how to control the default back color of content displayed in
a web browser control? 9 13115
FYI, Also I've tried changing the back color in the PPT slides before
converting them to HTML - that works for the slide background but the space
around the slide is still white...
"hz****@nopost.com" wrote: I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:3D**********************************@microsof t.com... I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
My web browser is part of my GUI... here's how its declared:
Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried
Me.browser.Document.bgColor = Color.Red
or
Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the
Document object is GetType.
Any other suggestions?
"Charles Law" wrote: You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com...I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red,
Color))
Note that because these methods use the document attribute, they must be
called when the document has been loaded, either in the DocumentComplete
event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:DD**********************************@microsof t.com... My web browser is part of my GUI... here's how its declared: Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried Me.browser.Document.bgColor = Color.Red or Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the Document object is GetType.
Any other suggestions?
"Charles Law" wrote:
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com... >I am using a web browser control to display some PPT slides saved as >HTML. >My > client has recently asked that the background of the browser be changed > to > sonething other than white so that the slides "standout". I've tried > setting > the browser's BackColor setting, but that had no effect at run time. > Any > suggestions on how to control the default back color of content > displayed > in > a web browser control?
Thanks for the reply, but I get compile error:
When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" -
Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote: Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... My web browser is part of my GUI... here's how its declared: Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried Me.browser.Document.bgColor = Color.Red or Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the Document object is GetType.
Any other suggestions?
"Charles Law" wrote:
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com... >I am using a web browser control to display some PPT slides saved as >HTML. >My > client has recently asked that the background of the browser be changed > to > sonething other than white so that the slides "standout". I've tried > setting > the browser's BackColor setting, but that had no effect at run time. > Any > suggestions on how to control the default back color of content > displayed > in > a web browser control?
There is an import that you could use, but I do not recommend using it
because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in
your References. Right-click the References section in the solution explorer
and select Add Reference. Then add a reference to Microsoft.mshtml from the
list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:CF**********************************@microsof t.com... Thanks for the reply, but I get compile error: When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" - Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote:
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... > My web browser is part of my GUI... here's how its declared: > Friend WithEvents browser As AxSHDocVw.AxWebBrowser > > So, when I tried > Me.browser.Document.bgColor = Color.Red > or > Me.browser.Document.body.style.backgroundColor = Color.Rad > > I got a run time error. The only method that looks to be available > under > the > Document object is GetType. > > Any other suggestions? > > > "Charles Law" wrote: > >> You could use >> >> AxWebBrowser1.Document.bgColor = "..." >> >> or >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:3D**********************************@microsof t.com... >> >I am using a web browser control to display some PPT slides saved as >> >HTML. >> >My >> > client has recently asked that the background of the browser be >> > changed >> > to >> > sonething other than white so that the slides "standout". I've >> > tried >> > setting >> > the browser's BackColor setting, but that had no effect at run time. >> > Any >> > suggestions on how to control the default back color of content >> > displayed >> > in >> > a web browser control? >> >> >>
Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles
browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the
background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote: There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... Thanks for the reply, but I get compile error: When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" - Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote:
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... > My web browser is part of my GUI... here's how its declared: > Friend WithEvents browser As AxSHDocVw.AxWebBrowser > > So, when I tried > Me.browser.Document.bgColor = Color.Red > or > Me.browser.Document.body.style.backgroundColor = Color.Rad > > I got a run time error. The only method that looks to be available > under > the > Document object is GetType. > > Any other suggestions? > > > "Charles Law" wrote: > >> You could use >> >> AxWebBrowser1.Document.bgColor = "..." >> >> or >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:3D**********************************@microsof t.com... >> >I am using a web browser control to display some PPT slides saved as >> >HTML. >> >My >> > client has recently asked that the background of the browser be >> > changed >> > to >> > sonething other than white so that the slides "standout". I've >> > tried >> > setting >> > the browser's BackColor setting, but that had no effect at run time. >> > Any >> > suggestions on how to control the default back color of content >> > displayed >> > in >> > a web browser control? >> >> >>
Are you certain that the border is not part of the converted slide?
You could also try posting this to
microsoft.public.inetsdk.programming.webbrowser_ct l, where Igor lives.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:CF**********************************@microsof t.com... Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote:
There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... > Thanks for the reply, but I get compile error: > When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not > defined" - > Is there an Import statement that I am missing? > > Thanks for your attention to this matter! > > > "Charles Law" wrote: > >> Option Strict On >> >> .... >> >> Dim doc As mshtml.IHTMLDocument2 >> >> doc = DirectCast(browser, mshtml.IHTMLDocument2) >> >> doc.bgColor = "Red" >> >> or >> >> doc.body.style.backgroundColor = >> ColorTranslator.ToHtml(CType(Color.Red, >> Color)) >> >> >> Note that because these methods use the document attribute, they must >> be >> called when the document has been loaded, either in the >> DocumentComplete >> event or after it has fired. >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:DD**********************************@microsof t.com... >> > My web browser is part of my GUI... here's how its declared: >> > Friend WithEvents browser As AxSHDocVw.AxWebBrowser >> > >> > So, when I tried >> > Me.browser.Document.bgColor = Color.Red >> > or >> > Me.browser.Document.body.style.backgroundColor = Color.Rad >> > >> > I got a run time error. The only method that looks to be available >> > under >> > the >> > Document object is GetType. >> > >> > Any other suggestions? >> > >> > >> > "Charles Law" wrote: >> > >> >> You could use >> >> >> >> AxWebBrowser1.Document.bgColor = "..." >> >> >> >> or >> >> >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> >> >> HTH >> >> >> >> Charles >> >> >> >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> >> >> wrote >> >> in >> >> message news:3D**********************************@microsof t.com... >> >> >I am using a web browser control to display some PPT slides saved >> >> >as >> >> >HTML. >> >> >My >> >> > client has recently asked that the background of the browser be >> >> > changed >> >> > to >> >> > sonething other than white so that the slides "standout". I've >> >> > tried >> >> > setting >> >> > the browser's BackColor setting, but that had no effect at run >> >> > time. >> >> > Any >> >> > suggestions on how to control the default back color of content >> >> > displayed >> >> > in >> >> > a web browser control? >> >> >> >> >> >> >> >> >>
No I'm not sure - being an HTML novice I'm not sure how to tell either... but
it looks like is now realted to the HTML, so I'll dig in an see is there's a
background colr being controled by the conversion of the PPT to HTML...
thanks for your help.
I'll repost this thread as you suggested.
"Charles Law" wrote: Are you certain that the border is not part of the converted slide?
You could also try posting this to microsoft.public.inetsdk.programming.webbrowser_ct l, where Igor lives.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote:
There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... > Thanks for the reply, but I get compile error: > When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not > defined" - > Is there an Import statement that I am missing? > > Thanks for your attention to this matter! > > > "Charles Law" wrote: > >> Option Strict On >> >> .... >> >> Dim doc As mshtml.IHTMLDocument2 >> >> doc = DirectCast(browser, mshtml.IHTMLDocument2) >> >> doc.bgColor = "Red" >> >> or >> >> doc.body.style.backgroundColor = >> ColorTranslator.ToHtml(CType(Color.Red, >> Color)) >> >> >> Note that because these methods use the document attribute, they must >> be >> called when the document has been loaded, either in the >> DocumentComplete >> event or after it has fired. >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:DD**********************************@microsof t.com... >> > My web browser is part of my GUI... here's how its declared: >> > Friend WithEvents browser As AxSHDocVw.AxWebBrowser >> > >> > So, when I tried >> > Me.browser.Document.bgColor = Color.Red >> > or >> > Me.browser.Document.body.style.backgroundColor = Color.Rad >> > >> > I got a run time error. The only method that looks to be available >> > under >> > the >> > Document object is GetType. >> > >> > Any other suggestions? >> > >> > >> > "Charles Law" wrote: >> > >> >> You could use >> >> >> >> AxWebBrowser1.Document.bgColor = "..." >> >> >> >> or >> >> >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> >> >> HTH >> >> >> >> Charles >> >> >> >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> >> >> wrote >> >> in >> >> message news:3D**********************************@microsof t.com... >> >> >I am using a web browser control to display some PPT slides saved >> >> >as >> >> >HTML. >> >> >My >> >> > client has recently asked that the background of the browser be >> >> > changed >> >> > to >> >> > sonething other than white so that the slides "standout". I've >> >> > tried >> >> > setting >> >> > the browser's BackColor setting, but that had no effect at run >> >> > time. >> >> > Any >> >> > suggestions on how to control the default back color of content >> >> > displayed >> >> > in >> >> > a web browser control? >> >> >> >> >> >> >> >> >> This discussion thread is closed Replies have been disabled for this discussion. Similar topics
20 posts
views
Thread by msa |
last post: by
|
6 posts
views
Thread by Nou Dadoun |
last post: by
|
3 posts
views
Thread by Al Franz |
last post: by
|
reply
views
Thread by max reason |
last post: by
|
9 posts
views
Thread by hzgt9b |
last post: by
|
1 post
views
Thread by celoftis |
last post: by
|
13 posts
views
Thread by anil.rita |
last post: by
|
reply
views
Thread by =?Utf-8?B?UmljaA==?= |
last post: by
|
3 posts
views
Thread by =?Utf-8?B?R3JlZw==?= |
last post: by
| | | | | | | | | | |