private void LoadMapDocument()
{
System.Windows.Forms.OpenFileDialog openFileDialog2;
openFileDialog2 = new OpenFileDialog();
openFileDialog2.Title = "Open Map Document";
openFileDialog2.Filter = "Map Documents (*.mxd)|*.mxd";
openFileDialog2.ShowDialog();
string sFilePath = openFileDialog2.FileName;
if (axMapControl1.CheckMxFile(sFilePath))
{
axMapControl1.MousePointer =
esriControlsMousePointer.esriPointerHourglass;
axMapControl1.LoadMxFile(sFilePath, 0,Type.Missing);
axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
}
else
{
MessageBox.Show(sFilePath + " is not a valid ArcMap document");
return;
}
}