I am using windows form for my application. I am loading another form on click of panel. Now I want to show sliding effect for opening and closing of form.I am able to add negative sliding effect while opening as form opens from right to left by overloading OnLoad event of form. But I am not able to hide the form with positive slide effect using AnimateWindow function. Is there any way to do this?
This is what I have used to show the form:
protected override void OnLoad(System.EventArgs e)
{
NativeMethods.AnimateWindow(this.Handle, 500,
AW_ACTIVATE | AW_SLIDE | AW_HOR_NEGATIVE);
base.OnLoad(e);
}
Using your existing pattern – OnClosing + AW_HIDE does it in reverse.