/// <summary> /// 键盘按下 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mapControl_eventKeyDown(object sender, _DHOSOFTMapControlEvents_eventKeyDownEvent e) { if (e.nChar == 27) { if (!isFinish) { //layer.RemoveElement(lineElement); if (!string.IsNullOrEmpty(tempName)) { mapControl.MgsDelObject(tempName); } listPoints.Clear(); isFinish = true; } else { ReleaseCommond(); } } if (e.nChar == 17) { isControl = true; mapControl.IMGS_WorkStation_SelectTool("GIS_TOOL_MAP_MOVE_HOSOFT"); } }
// private void mapControl_eventKeyDown(object sender, _DHOSOFTMapControlEvents_eventKeyDownEvent e) { if (e.nChar == (uint)ConsoleKey.Escape) { ReleaseCommond(); } }
//地图控件键盘按下事件 private void axMapControl_eventKeyDown(object sender, _DHOSOFTMapControlEvents_eventKeyDownEvent e) { if (Utils.bPublishEvent == false) { return; } MFKeyEventArgs args = new MFKeyEventArgs(); args.KeyEventArgs = new KeyEventArgs((Keys)e.nChar); if (KeyDownEvent != null) { KeyDownEvent.Invoke(this, args); } }
/// <summary> /// 键盘按下事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mapControl_eventKeyDown(object sender, _DHOSOFTMapControlEvents_eventKeyDownEvent e) { if (mapControl.InvokeRequired) { mapControl.Invoke(new Action(delegate { if (e.nChar == 27) { ReleaseCommond(); } else if (e.nChar == 17) { isControl = true; mapControl.IMGS_WorkStation_SelectTool("GIS_TOOL_MAP_MOVE_HOSOFT"); } })); } else { if (e.nChar == 27) { ReleaseCommond(); } else if (e.nChar == 17) { isControl = true; mapControl.IMGS_WorkStation_SelectTool("GIS_TOOL_MAP_MOVE_HOSOFT"); } } //if (e.nChar == 27) //{ // ReleaseCommond(); //} //else if (e.nChar == 17) //{ // isControl = true; // mapControl.IMGS_WorkStation_SelectTool("GIS_TOOL_MAP_MOVE_HOSOFT"); //} }
/// <summary> /// 键盘按下 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mapControl_eventKeyDown(object sender, _DHOSOFTMapControlEvents_eventKeyDownEvent e) { if (e.nChar == 27) { if (!isFinish) { if (!string.IsNullOrEmpty(tempName)) { mapControl.MgsDelObject(tempName); } isMouseDown = false; isFinish = true; } else { ReleaseCommond(); } } else if (e.nChar == 17) { isControl = true; mapControl.IMGS_WorkStation_SelectTool("GIS_TOOL_MAP_MOVE_HOSOFT"); } }