473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Web Browser Control - controlling the background color...

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?
Sep 20 '05 #1
9 13659
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?

Sep 20 '05 #2
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?

Sep 21 '05 #3
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?


Sep 21 '05 #4
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?


Sep 22 '05 #5
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?


Sep 22 '05 #6
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?
>>
>>
>>


Sep 22 '05 #7
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?
>>
>>
>>


Sep 22 '05 #8
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?
>> >>
>> >>
>> >>
>>
>>
>>


Sep 22 '05 #9
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?
>> >>
>> >>
>> >>
>>
>>
>>


Sep 22 '05 #10

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

Similar topics

20
by: msa | last post by:
Hi there, First off, let me say that I know that launching to full screen is a bad idea. I would never do it given the choice, but I must follow orders from my boss, the boss that desparately...
6
by: Nou Dadoun | last post by:
I'm currently developing an application in C++/MFC (Visual Studio 6, if that makes a difference) and I'd like to avoid the Windows style UI widgets and dialogs if at all possible. In fact, what...
3
by: Al Franz | last post by:
Have done popup browsers from links before controlling width, height, menu bars, etc. using javascript. But what if you want to control the parameters of the initial browser window to open. Such...
0
by: max reason | last post by:
I added the WebBrowser component to my toolbox, then placed one on a form with other .NET components. This much seems to have worked, but I do not understand how to control the sucker from within...
9
by: hzgt9b | last post by:
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...
1
by: celoftis | last post by:
BACKGROUND: I have some PPT slides that have been converted to HTM (ensuring that the show slide animations while browsing checkbox is checked). The original HTM slides have custom animations to...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
0
by: =?Utf-8?B?UmljaA==?= | last post by:
I have a web browser control (VB2005) in a panel on a form. I use it only to open Reports from Reporting Services (sql Server 2000) or PDFs. So I am not using the web browser control for browsing...
3
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am used to using third party controls when it comes to setting up appearences. But, now I am using Visual Basic.Net controls that come standard with the product. I've come across a frustration...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.