473,395 Members | 1,527 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,395 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 13667
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...

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.