예제 #1
0
 private void FrmSecondDMain_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.Shift && e.KeyCode == Keys.S)
         {
             this.bar1.Visible = !this.bar1.Visible;
         }
         else if (e.Control && e.KeyCode == Keys.F)
         {
             using (FrmFindLand frm = new FrmFindLand())
             {
                 if (frm.ShowDialog() == DialogResult.OK)
                 {
                     using (WaitDialogForm dialog = new WaitDialogForm("正在查找,请稍后...", "提示"))
                     {
                         IDrawObject land = (from a in m_data.ActiveLayer.Objects
                                             where a.Id == "LandMark" && (a as LandMarkTool).LandCode == frm.LandCode
                                             select a).FirstOrDefault();
                         if (land != null)
                         {
                             (land as LandMarkTool).Selected = true;
                         }
                         else
                         {
                             MsgBox.ShowWarn("未找到地标号" + frm.LandCode + "!");
                             return;
                         }
                         m_data.AddSelectedObject(land);
                         m_canvas.DoInvalidate(true);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     { MsgBox.ShowError(ex.Message); }
 }