在 GMapControl 中如何正确处理使用鼠标按下和移动 Google map ?
GMapControl gMap = new GMapControl();
gMap.MouseDown += GMap_MouseDown;
private void GMap_MouseDown(object sender, MouseEventArgs e)
{
gMap.MouseMove += GMap_MouseMove;
}
private void GMap_MouseMove(object sender, MouseEventArgs e)
{
base.OnMouseMove(e);
//gMap.Position = new PointLatLng(X, Y);
}
最佳答案
您不需要任何代码来移动 map 。默认是鼠标右键移动 map ,我觉得这很尴尬。要更改为左鼠标,请在表单的 Load() 事件中使用如下代码:
gMap.DragButton = MouseButtons.Left;
关于winforms - GMap.NET Windows Forms 用鼠标移动 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44462443/