private void LoadMxdFile(string filename) { if (axPageLayoutControl1.CheckMxFile(filename)) { //ESRI.ArcGIS.Framework.IDocument doc = new ESRI.ArcGIS.ArcMapUI.MxDocumentClass(); //m_application = doc.Parent; //m_application.Visible = false; //mxdocument = m_application.Document as IMxDocument; mapdocument = new MapDocument(); mapdocument.Open(filename); map = mapdocument.Map[0]; mapdocument.SetActiveView((IActiveView)map); m_pageLayoutControl = (IPageLayoutControl2)axPageLayoutControl1.Object; m_pageLayoutControl.PageLayout = mapdocument.PageLayout; //axPageLayoutControl1.LoadMxFile(filename); this.Text = mapdocument.DocumentFilename; saveAsToolStripMenuItem.Enabled = true; saveToolStripMenuItem.Enabled = true; printToolStripMenuItem.Enabled = true; } else { MessageBox.Show("The Selected file is not suppoted !!!"); } }