![]() |
This document is archived and information here might be outdated. Recommended version. |
| ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Move Application Window to Center Snippet (ArcObjects .NET 10.4 SDK) |
Move application back to center if not completely visible on screen.
///<summary>Move application back to center if not completely visible on screen.</summary>
///
///<param name="application">An IApplication interface.</param>
///
/// <remarks></remarks>
public void MoveApplicationWindowToCenter(ESRI.ArcGIS.Framework.IApplication application)
{
ESRI.ArcGIS.Framework.IWindowPosition windowPos=application as ESRI.ArcGIS.Framework.IWindowPosition;
if (windowPos.State == ESRI.ArcGIS.Framework.esriWindowState.esriWSNormal)
{
windowPos.Left=10;
windowPos.Top=10;
}
}
'''<summary>Move application back to center if not completely visible on screen.</summary>
'''
'''<param name="application">An IApplication interface.</param>
'''
''' <remarks></remarks>
Public Sub MoveApplicationWindowToCenter(ByVal application As ESRI.ArcGIS.Framework.IApplication)
Dim windowPos As ESRI.ArcGIS.Framework.IWindowPosition=CType(application, ESRI.ArcGIS.Framework.IWindowPosition)
If windowPos.State=ESRI.ArcGIS.Framework.esriWindowState.esriWSNormal Then
windowPos.Left=10
windowPos.Top=10
End If
End Sub