Webbrowser control : Removing redraw when changing pages

  • Thread starter Thread starter Martin Slater
  • Start date Start date
M

Martin Slater

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
 
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.
 
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
 
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.
 
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
 
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
 
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
 
Back
Top