This document is archived and information here might be outdated. Recommended version. |
Provides access to members that work with a dialog for getting coordinates.
Name | Description | |
---|---|---|
DoModal | Shows the dialog. | |
X | The X value entered in the dialog. | |
Y | The Y value entered in the dialog. |
CoClasses and Classes | Description |
---|---|
CoordinateDialog | A dialog used for getting coordinates. |
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() .
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.");
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