By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

Webbrowser control : Removing redraw when changing pages

P: n/a
Hi all,
I'm using a webbrowser control within an application for the UI and want
to hide the flicker and redraw when changing pages. Ideally I want to
render the new page to a seperate offscreen buffer then fade this over
the exisiting page. Can anyone recommend a good way to approach this?

thanks

Martin
Jul 20 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Martin,

That's something that I think is really beyond your control. There are
a number of things that are going on when you reload a page, even if you are
limiting yourself to just the redrawing operation (the page elements, active
x controls, etc, etc) and the WebBrowser control doesn't allow hooks into
that operation.

If you have control of the server side, you are better off using AJAX to
load data into the page and then modify the elements of the page after it
downloads data from the server.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Martin Slater" <ms*****@hellinc.netwrote in message
news:48*********************@news.astraweb.com...
Hi all,
I'm using a webbrowser control within an application for the UI and want
to hide the flicker and redraw when changing pages. Ideally I want to
render the new page to a seperate offscreen buffer then fade this over the
exisiting page. Can anyone recommend a good way to approach this?

thanks

Martin
Jul 20 '08 #2

P: n/a
Thanks for the reply Nicholas, I'm gonna still remain hopeful for a bit
longer until the more 'hacky' options are eliminated as well;)

I tried to fake this by creating 2 webbrowser controls, hiding the one
that is currently loading then flipping them when the hidden page is
fully loaded (by waiting for a DocumentCompleted event) but this didn't
seem to work. Do you have any idea if
a) a hidden webbrowser control will render anything at all (or a way
to make it do so without being visible on screen)
b) a DocumentCompleted event is fired after the page has fully and
completely loaded?

thanks again

Martin

Nicholas Paldino [.NET/C# MVP] wrote:
Martin,

That's something that I think is really beyond your control. There
are a number of things that are going on when you reload a page, even if
you are limiting yourself to just the redrawing operation (the page
elements, active x controls, etc, etc) and the WebBrowser control
doesn't allow hooks into that operation.

If you have control of the server side, you are better off using AJAX
to load data into the page and then modify the elements of the page
after it downloads data from the server.

Jul 20 '08 #3

P: n/a
It might be better to take an image of the browser control before it flickers
and show that over the top while your control renders the new page. Then you
could put it front when the loading has completed. I have a class on my blog
(specified below) which will give you an image for a control. You could then
use that in a picturebox. Would probably be a lot more light weight then
having 2 browsers.

I cant answer you first question you asked, but the document completed event
does fire after everything has been loaded. Including all images as well I
believe.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Martin Slater" wrote:
Thanks for the reply Nicholas, I'm gonna still remain hopeful for a bit
longer until the more 'hacky' options are eliminated as well;)

I tried to fake this by creating 2 webbrowser controls, hiding the one
that is currently loading then flipping them when the hidden page is
fully loaded (by waiting for a DocumentCompleted event) but this didn't
seem to work. Do you have any idea if
a) a hidden webbrowser control will render anything at all (or a way
to make it do so without being visible on screen)
b) a DocumentCompleted event is fired after the page has fully and
completely loaded?

thanks again

Martin

Nicholas Paldino [.NET/C# MVP] wrote:
Martin,

That's something that I think is really beyond your control. There
are a number of things that are going on when you reload a page, even if
you are limiting yourself to just the redrawing operation (the page
elements, active x controls, etc, etc) and the WebBrowser control
doesn't allow hooks into that operation.

If you have control of the server side, you are better off using AJAX
to load data into the page and then modify the elements of the page
after it downloads data from the server.
Jul 20 '08 #4

P: n/a
I haven't tried this, but it might be possible to use JavaScript to fade
out/in the page as long as you can programmatically alter the HTML
code/OnLoad (OnUnload?) events inside the WebBrowser. There are webpages
which do exactly this.

Best Regards,
Stanimir Stoyanov | www.stoyanoff.info

"Martin Slater" <ms*****@hellinc.netwrote in message
news:48*********************@news.astraweb.com...
Hi all,
I'm using a webbrowser control within an application for the UI and want
to hide the flicker and redraw when changing pages. Ideally I want to
render the new page to a seperate offscreen buffer then fade this over the
exisiting page. Can anyone recommend a good way to approach this?

thanks

Martin
Jul 20 '08 #5

P: n/a
On Jul 20, 6:28*am, Martin Slater <msla...@hellinc.netwrote:
Hi all,

I'm using a webbrowser control within an application for the UI and want
to hide the flicker and redraw when changing pages. Ideally I want to
render the new page to a seperate offscreen buffer then fade this over
the exisiting page. Can anyone recommend a good way to approach this?

thanks

Martin
Jul 22 '08 #6

P: n/a
On Jul 20, 6:28*am, Martin Slater <msla...@hellinc.netwrote:
Hi all,

I'm using a webbrowser control within an application for the UI and want
to hide the flicker and redraw when changing pages. Ideally I want to
render the new page to a seperate offscreen buffer then fade this over
the exisiting page. Can anyone recommend a good way to approach this?

thanks

Martin
Dear Martin
I am not very much practiced person of .NET . But here I may suggest
something.
You can make the browser window transperent (don't make fully
transprent) I saw similar appreach in "Paint.NET" . Just google it.
Its opensource software. In it when you move the mouse out of the
color toolbox that tool window becomes opaque.

yours
Advait
Jul 22 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.