Gets the native window handle of the main application window. Can be used to parent dialogs and message boxes correctly.

Namespace:  ESRI.ArcGISExplorer.Application

Assembly:  ESRI.ArcGISExplorer.Application (in ESRI.ArcGISExplorer.Application.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public static IWin32Window Window { get; }
Visual Basic (Declaration)
Public Shared ReadOnly Property Window As IWin32Window

Field Value

The native window handle.

Remarks

This property is useful for setting the owner property of .NET forms and dialogs, associating the dialog correctly as belonging to the ArcGIS Explorer application; this helps ensure that the dialog is always on top of the main application window, even if the dialog is non-modal, or the user switches away from the application and back again.

An IWin32Window reference can often be passed in as an argument to methods which show a .NET dialog, for example the Show and ShowDialog methods on the System.Windows.Forms.Form class.

Examples

The example code below shows a message box being shown using the IWin32Window returned from the Application.Window property to set the parent of the dialog correctly before it is shown.
CopyC#
DialogResult deSel = MessageBox.Show(ESRI.ArcGISExplorer.Application.Application.Window,
    "Do you want to deselect all items in the Contents?", "Deselect All?",    
    MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (deSel == DialogResult.Yes)
{
    ESRI.ArcGISExplorer.Application.Application.SelectedItems.Clear();
}
CopyVB.NET
Dim deSel As DialogResult = MessageBox.Show(ESRI.ArcGISExplorer.Application.Application.Window, _
 "Do you want to deselect all items in the Contents?", "Delselect All?", _
 MessageBoxButtons.YesNo, MessageBoxIcon.Question)

If deSel = DialogResult.Yes Then
    ESRI.ArcGISExplorer.Application.Application.SelectedItems.Clear()
End If

See Also