当前位置: 代码迷 >> C# >> c# axPageLayoutControl 添数据框
  详细解决方案

c# axPageLayoutControl 添数据框

热度:136   发布时间:2016-05-05 02:48:40.0
c# axPageLayoutControl 加数据框

private void axPageLayoutControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IPageLayoutControlEvents_OnMouseDownEvent e)
{
if (e. button == 1) return;

//Create an envelope by tracking a rectangle
IEnvelope envelope = axPageLayoutControl1.TrackRectangle();

//Create a map frame element with a new map
IMapFrame mapFrame = new MapFrameClass();
mapFrame.Map = new MapClass();

//Add the map frame to the PageLayoutControl with specified geometry
axPageLayoutControl1.AddElement((IElement)mapFrame, envelope, null, null, 0);
//Refresh the PageLayoutControl
axPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewGraphics, null, null);
}

  相关解决方案