![]() |
This document is archived and information here might be outdated. Recommended version. |
| ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Fade Windows Form Closed Snippet (ArcObjects .NET 10.4 SDK) |
Cause a System.Windows.Form to close in a faded way.
///<summary>Cause a System.Windows.Form to close in a faded way.</summary>
///
///<param name="myForm">A System.Windows.Form object</param>
///
///<remarks>This will cause the form to close by making it seem to disappear gradually.</remarks>
public void FadeWindowsFormClosed(System.Windows.Forms.Form myForm)
{
for (System.Int32 i=10; i >= 0; i--)
{
myForm.Opacity=myForm.Opacity - 0.1;
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(100);
i=i - 1;
}
myForm.Close();
}
'''<summary>Cause a System.Windows.Form to close in a faded way.</summary>
'''
'''<param name="myForm">A System.Windows.Form object</param>
'''
'''<remarks>This will cause the form to close by making it seem to disappear gradually.</remarks>
Public Sub FadeWindowsFormClosed(ByVal myForm As System.Windows.Forms.Form)
Dim i As System.Int32
For i=10 To 0 Step -1
myForm.Opacity=myForm.Opacity - 0.1
System.Windows.Forms.Application.DoEvents()
System.Threading.Thread.Sleep(100)
i=i - 1
Next
myForm.Close()
End Sub