Detecting Resize Completion?

  • Thread starter Thread starter Dave Veeneman
  • Start date Start date
D

Dave Veeneman

Is there a simple way to detect when a resize is completed? I'm writing a
custom control, and I want the control to repaint itself when a resizing is
complete, but not during the resizing. The SizeChanged, Resize, and Layout
events all seem to fire repeatedly during the resize.

Is there an event that fires on completion of a resize, but not during the
resize? If I want to repaint ony when the resize is complete, what's the
best way to trigger the repaint? Thanks.
 
I think resize is never complete - that's your problem.

Try to find moment when resize is complete - how you would define it? After
1 second, 1 minute or 1 hour? Or maybe 1 day? If you can define moment when
it is complete - there you go, detect this moment and repaint.

HTH
Alex
 
Hi Dave,

The underlying windows messages are WM_ENTERSIZECHANGE, WM_EXITSIZECHANGE.
You could try overriding WndProc to trap these and set a flag to inhibit
painting between the two messages.

Cheers

Doug Forster
 
Does the LH api fix these or are we eterinally always going to override
WndProc and go native for the lacking areas?
 
Hi Alex,

Sorry you are right, slight memory slip there. I haven't actually used these
with a managed app so I'd be interested to know if they do what you want.

Cheers

Doug Forster
 
Back
Top