Groups | Blog | Home
all groups > dotnet drawing api > june 2005 >

dotnet drawing api : Form Scrolling


Andrew
6/28/2005 9:18:01 PM
I have noticed that the scroll state of the form has an effect upon the
results of executing the Update() function.

Refering the the Microsoft SDK notes, the Upate() method " Causes the
control to redraw the invalidated regions within its client area."

In the OnMouseDown of one of my forms, I invalidate two rectangles then
cause a synchronous paint by calling Update(). The result is that the
contents of those two rectangles are immediately repainted.

ie Invalidate(rc1);
Invalidate(rc2);
Update();

This is indeed the case when the form has not been scrolled, however when
scrolled, the invalidated regions are not immediately drawn.

I need to go to another form and then return to this form to see the
repainted rectangle regions.

Can anyone please explain why the scroll causes such a result ?

Yes I have tried calling Refresh() instead of Update() and this does indeed
cause an immediate redraw (regardless of the scroll state) however this
naturally causes the entire form contents the be redrawn which is not the
required result)

Regards


Andrew
7/2/2005 1:52:01 AM
Does anyone have a comment on this issue ?

[quoted text, click to view]
Andrew
7/5/2005 11:01:01 PM
Hello,

Just a quick note to say that my original assertion that the scroll state
affects the result of the Update() function, is incorrect.

I am working through solving this problem and the problem seems to be due to
some sort of redrawing problem when a scroll is in effect.

My apologies and I will provide a brief update (?) when I know exactly what
caused the original issue

Andrew

[quoted text, click to view]
Andrew
7/6/2005 10:29:02 PM
Now that I have a proper appreciation of scrolling,cliprectangle generation,
invalidation.... the form drawing handles scrollling nicely.


[quoted text, click to view]
AddThis Social Bookmark Button