This document is archived and information here might be outdated.  Recommended version.


ICoordinateDialog Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > Framework > ESRI.ArcGIS.Framework > Interfaces > IC > ICoordinateDialog Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Framework)  

ICoordinateDialog Interface

Provides access to members that work with a dialog for getting coordinates.

Product Availability

Available with ArcGIS Desktop.

Members

Name Description
Method DoModal Shows the dialog.
Read-only property X The X value entered in the dialog.
Read-only property Y The Y value entered in the dialog.

CoClasses that implement ICoordinateDialog

CoClasses and Classes Description
CoordinateDialog A dialog used for getting coordinates.

Remarks

The coordinate dialog is a dialog used for getting user input in the form of X and Y coordinates.

To get access to the ICoordinateDialog interface you would create a new CoordinateDialog object.

The following code shows a CoordinateDialog and reports the X and Y values. You would get m_app from the hook in ICommand::OnCreate() .

[C#]

ICoordinateDialog pCoordDlg=new CoordinateDialogClass();
bool valid=pCoordDlg.DoModal("Enter X & Y coordinates", 1, 1, 3, m_app.hWnd);
if (valid)
  System.Windows.Forms.MessageBox.Show("X: " + pCoordDlg.X.ToString() + "\n" + "Y: " + pCoordDlg.Y.ToString());
else
  System.Windows.Forms.MessageBox.Show("Bad entries.");

[Visual Basic .NET]

Dim pCoordDlg As ICoordinateDialog=New CoordinateDialogClass()
Dim valid As Boolean=pCoordDlg.DoModal("Enter X & Y coordinates", 1, 1, 3, m_app.hWnd)
If valid Then
 System.Windows.Forms.MessageBox.Show("X: " + pCoordDlg.X.ToString() + vbLf + "Y: " + pCoordDlg.Y.ToString())
Else
 System.Windows.Forms.MessageBox.Show("Bad entries.")
End If

See Also

INumberDialog Interface | NumberDialog Class