在C#2010+ArcGIS Engine10开发,toolbarcontrol中item中某项怎么用代码赋值,比如给GoToXY中x和y用代码赋值,请高手指教。
------解决方案--------------------
参考:
ArcEngine的ToolbarControl解析
向ArcGIS的ToolBarControl中添加任意的windows组建的方法
------解决方案--------------------
Public Sub GotoXY()
Dim pMxDoc As IMxDocument
Dim pEnv As IEnvelope
Dim pPt As IPoint
Dim pXYDlg As ICoordinateDialog
Dim bXYok As Boolean
' Get the coords
Set pXYDlg = New CoordinateDialog
bXYok = pXYDlg.DoModal("Enter Coords To Goto", 0, 0, 4, Application.hWnd)
If Not bXYok Then Exit Sub
' Create a point for the coords
Set pPt = New Point
pPt.PutCoords pXYDlg.X, pXYDlg.Y
' Centre the map at those coords
Set pMxDoc = ThisDocument
Set pEnv = pMxDoc.ActiveView.Extent
pEnv.CenterAt pPt
pMxDoc.ActiveView.Extent = pEnv
pMxDoc.ActiveView.Refresh
End Sub
参考:
go to X,Y point
------解决方案--------------------
参考:
Moving around on the map