MapWinGIS:AxMap CursorMode
From MapWindow GIS
CursorMode
Gets or sets the cursor mode for the map. The cursor mode determines how the map handles mouse click events on the map. The only mode not handled by the map is cmNone.
VB.NET Usage
Property CursorMode() As MapWinGIS.tkCursorMode
Parameters
|
ReturnValue | The current cursor mode for the map as a MapWinGIS.tkCursorMode object. |
Sample Code
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Dim tag As String
'Get the tag for the button that was clicked on the toolbar
tag = e.Button.Tag
'Select the right cursor mode to switch to
Select Case (tag)
Case "Arrow"
'Set cursor mode to cmNone where clicks on map have no effect on the map view
Map1.CursorMode = MapWinGIS.tkCursorMode.cmNone
Case "ZoomIn"
'Set cursor mode to cmZoomIn where left clicks on map zoom in map view
Map1.CursorMode = MapWinGIS.tkCursorMode.cmZoomIn
Case "ZoomOut"
'Set cursor mode to cmZoomOut where left clicks on map zoom out map view
Map1.CursorMode = MapWinGIS.tkCursorMode.cmZoomOut
Case "Pan"
'Set cursor mode to cmPan where holding down the left mouse button and dragging
' pans contents of the map changing what is shown in the map view
Map1.CursorMode = MapWinGIS.tkCursorMode.cmPan
Case "Select"
'Set cursor mode to cmSelection where clicking and dragging selects items in the map view
Map1.CursorMode = MapWinGIS.tkCursorMode.cmSelection
End Select
End Sub
VB 6 Usage
Property CursorMode() As tkCursorMode
Parameters
|
ReturnValue | The current cursor mode for the map as a tkCursorMode object. |
Sample Code
Private Sub btnCursorMode_Click(Index As Integer)
'Select the right cursor mode to switch to
Select Case (Index)
Case 0
'Set cursor mode to cmNone where clicks on map have no effect on the map view
Map1.CursorMode = cmNone
Case 1
'Set cursor mode to cmZoomIn where left clicks on map zoom in map view
Map1.CursorMode = cmZoomIn
Case 2
'Set cursor mode to cmZoomOut where left clicks on map zoom out map view
Map1.CursorMode = cmZoomOut
Case 3
'Set cursor mode to cmPan where holding down the left mouse button and dragging
' pans contents of the map changing what is shown in the map view
Map1.CursorMode = cmPan
Case 4
'Set cursor mode to cmSelection where clicking and dragging selects items in the map view
Map1.CursorMode = cmSelection
End Select
End Sub
















