PC Review


Reply
Thread Tools Rate Thread

Behavior of WebBrowser Control

 
 
Michael Groeger
Guest
Posts: n/a
 
      14th Apr 2009
Hi,

I am trying to create a control which adds rounded borders to the WebBrowser
Control. The content of the WebBrowser control should be visible inside of
the round borders, outside of the borders the background should be white.

I tried to achieve this on several ways:
- subclass WebBrowser control:
Add a round border in OnPaint. Draw white background in OnPaint outside of
the round border.
=> Does not work, WebBrowser control always overpaints its contents over
everything the inherited control paints itself.

- overlay WebBrowser control:
Add an instance to the form. Create a Control with round borders, which
supports transparency inside of the border and draws a white background
outside of the border. Add an instance of this control to the form with the
same size and position as the WebBrowser control's instance. Ensure that it
is on-top of the WebBrowser control's instance.
=> Does not work. The WebBrowser control seems to draw its content directly
"on screen" and not into the control.

Does somebody have an idea how to solve this?

Regards,
Michael
 
Reply With Quote
 
 
 
 
Jesse Houwing
Guest
Posts: n/a
 
      14th Apr 2009
Hello Michael,

> Hi,
>
> I am trying to create a control which adds rounded borders to the
> WebBrowser Control. The content of the WebBrowser control should be
> visible inside of the round borders, outside of the borders the
> background should be white.
>
> I tried to achieve this on several ways:
> - subclass WebBrowser control:
> Add a round border in OnPaint. Draw white background in OnPaint
> outside of
> the round border.
> => Does not work, WebBrowser control always overpaints its contents
> over
> everything the inherited control paints itself.
> - overlay WebBrowser control:
> Add an instance to the form. Create a Control with round borders,
> which
> supports transparency inside of the border and draws a white
> background
> outside of the border. Add an instance of this control to the form
> with the
> same size and position as the WebBrowser control's instance. Ensure
> that it
> is on-top of the WebBrowser control's instance.
> => Does not work. The WebBrowser control seems to draw its content
> directly
> "on screen" and not into the control.
> Does somebody have an idea how to solve this?


Do you have full control over the contents of the browser control? I mean,
it's pretty easy to add rounded borders to the content of the control, instead
of trying to paint over the embedded Internet Explorer instance.

Another option would be to draw the rounded corners and have a bit of a margin
in which the webbrowser control is placed. Not ideal, but it should work...

--
Jesse Houwing
jesse.houwing at sogeti.nl


 
Reply With Quote
 
Michael Groeger
Guest
Posts: n/a
 
      15th Apr 2009
Thanks for your reply Jesse!

> Do you have full control over the contents of the browser control? I mean,
> it's pretty easy to add rounded borders to the content of the control, instead
> of trying to paint over the embedded Internet Explorer instance.


Unfortunately not. The content displayed is provided by a other company.

> Another option would be to draw the rounded corners and have a bit of a margin
> in which the webbrowser control is placed. Not ideal, but it should work...


The content should expand to the area inside the rounded borders. But this
maybe an option to discuss.

Regards,
Michael
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
webbrowser control: how to capture event of mouse hovering over thelink or mouse click events in webbrowser only? P-GPS Microsoft VB .NET 1 15th Dec 2007 11:31 AM
WebBrowser flicker and Treeview select behavior SirPoonga Microsoft C# .NET 0 21st Feb 2007 08:51 PM
WebBrowser control : need help controlling browser control from within VC++ .NET 2003 program max reason Microsoft VC .NET 0 24th Feb 2004 05:02 AM
Handling click of grid control from webbrowser control in windows form =?Utf-8?B?UHJhbmF0aQ==?= Microsoft VB .NET 0 22nd Jan 2004 04:11 AM
Handling click of grid control from webbrowser control in windows form =?Utf-8?B?UHJhbmF0aQ==?= Microsoft VB .NET 0 22nd Jan 2004 04:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 AM.