Hi Diogo,
you could try not redrawing any of the controls on the form until after
the resize has occurred, at which point you can call Invalidate() to redraw
your form. This will nearly give the effect you are looking for. You would
invalidate on the Idle event of the application when there is no more work to
be processed by the application. For example:
private bool _Idle = false;
protected override void OnResize(EventA rgs e)
{
//We only want to do this processing the first time resize is called
if(!_Idle)
{
//add event handler to wait for idle event when we can redraw the
screen
//after a resize has completed
_Idle = true;
//stop any controls being redrawn
this.SuspendLay out();
//add the event handler
Application.Idl e += new EventHandler(Ap plication_Idle) ;
}
base.OnResize (e);
}
private void Application_Idl e(object sender, EventArgs e)
{
//if we are idle
if(_Idle)
{
_Idle = false;
//remove the event we do not want it any more
Application.Idl e -= new EventHandler(Ap plication_Idle) ;
//allow controls to be redrawn
this.ResumeLayo ut();
//cause form to be repainted after the resize
this.Invalidate ();
}
}
Hope that helps
Mark R Dawson
"Diogo Alves - Software Developer" wrote:
Hi there,
Since my last questions wasn't very clear, I will do it in a different way.
I want to resize my app but while resizing I dont want to see content of the
form, I just want to see the window border, then on release, the form
reappears, just like when we use "Show window contents while dragging" on the
windowsXP appearance settings...
Any Ideas in how to do it?