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