MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:AxMap CursorMode

From MapWindow GIS

Jump to: navigation, search

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://www.mapwindow.org/wiki/index.php/MapWinGIS:AxMap_CursorMode"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: November 12 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links