MapWinGIS:AxMap CursorMode

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

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

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:AxMap_CursorMode"

This page has been accessed 2,415 times. This page was last modified on 9 November 2005, at 18:55.