1,第一种方法 MapControl  直接添加

 

if (!axMapControl1.CheckMxFile(FileName))
{
MessageBox.Show("文件不合法");
return;
}
else
{

axMapControl1.LoadMxFile(FileName);
}

  

第二种方法:通过MapDocument  进行添加

   string FileName = open.FileName;
                IMapDocument mapDoc = new MapDocument();
                mapDoc.Open(FileName, "");
                axMapControl1.Map = mapDoc.ActiveView.FocusMap;
                axMapControl1.ActiveView.Refresh();

  

相关文章:

  • 2021-12-22
  • 2021-05-01
  • 2021-11-30
  • 2021-12-03
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-11-08
  • 2021-07-08
  • 2021-09-09
相关资源
相似解决方案