IGeometry pGeo;
pGeo = mMapControl.TrackLine();//画线工具
ILineElement pLineElement;
pLineElement = new LineElementClass();
IElement pElement;
pElement = pLineElement as IElement;
pElement.Geometry = pGeo;
//设置线符号的颜色和线宽
ISimpleLineSymbol pSymbol = new SimpleLineSymbolClass();
pSymbol.Color = MapManager.GetRgbColor(0, 0, 255);
pSymbol.Width = 1.5;
pLineElement.Symbol = pSymbol;
//在图形容器中添加并显示所画的线
pGraphicsContainer = m_Map as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
m_activeView.Refresh();