ThinkGeo.com    |     Documentation    |     Premium Support

Map click

Hello:


I have problems with the map click event. I´m using the sample applications (DetermineWhereUserClickInWorldCoordinate) but it's on C# and maybe in VB.NET I need more code lines or something. I have never worked with events and I don't know how to make it raise



Tiffany,


You can easily add an event handler in the VS designer. As the picture below, you can click the map control, click Events Button in the property window, and then choose the event you want to add.



Or you can directly add the following codes to hook up the event.


 

Private Sub WinformsMap1_MapClick(ByVal sender As System.Object, ByVal e As ThinkGeo.MapSuite.DesktopEdition.WinformsMapClickEventArgs) Handles WinformsMap1.MapClick
End Sub

 
Any queries please let us know.
 
Ben

Sorry, maybe I’m misunderstood. I know that. You can do doubleclick over the map too, or select it in the vb code with the combo box wich is over. 
 What I mean is that it doesn’t works. It doesn´t matter how many times or the way I clicked, it never rise the event.

Tiffany 
  
 That sample (DetermineWhereUserClickInWorldCoordinate) uses event Map1.MapClick instead of Map1.Click. Map1.MapClick will be raised when you click on the map and not panning (if mouse moves after mouse down, this event will be canceled) which will be helpful for some cases. 
  
 Now the event Map1.Click (and some other events like Map1.DoubleClick) has been disabled temporarily in the current release, this is a bug and we will enable it in the next beta. Sorry for the inconvenience. 
  
 Ben. 


Thank you Ben! 
 I was trying with the click event, not  mapclick.  I’m sorry to cause you so much trouble. 


It’s not trouble, it’s my pleasure. :)  Any more queries just let us know.