private void EditClientForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SaveButton.PerformClick();
     }
 }
Exemple #2
0
 /// <summary>
 /// 最后一个控件回车时的回调
 /// </summary>
 protected void LastControlAction()
 {
     if (IsNew)
     {
         if (SaveNewButton != null && SaveNewButton.Enabled)
         {
             SaveNewButton.Select();
             SaveNewButton.PerformClick();
         }
         else
         {
             SelectFirstControl();
         }
     }
     else
     {
         if (SaveButton != null && SaveButton.Enabled)
         {
             SaveButton.Select();
             SaveButton.PerformClick();
         }
         else
         {
             SelectFirstControl();
         }
     }
 }
Exemple #3
0
        private void EditForm_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.F4:
                if (e.Alt)
                {
                    if (MessageBox.Show(
                            "Редактирование еще не завершено.\nВы действительно желаете закрыть это окно?",
                            "Стоп-стоп-стоп...", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                        DialogResult.No)
                    {
                        e.Handled = true;
                    }
                }
                break;

            case Keys.Enter:
                if (e.Control)
                {
                    SaveButton.PerformClick();
                }
                break;
            }
        }
 private void nameTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SaveButton.PerformClick();
         e.SuppressKeyPress = true;
     }
 }
Exemple #5
0
 private void FormKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.S && e.Control)
     {
         SaveButton.PerformClick();
     }
     if (e.KeyCode == Keys.Z && e.Control)
     {
         BackButton.PerformClick();
     }
 }
Exemple #6
0
        //新建工程
        public void NewProject()
        {
            if (myProjectPath != "")
            {
                if (DialogResult.No == MessageBox.Show("工程已存在,确实要新建吗?", "Alert", MessageBoxButtons.YesNo))
                {
                    return;
                }

                SaveButton.PerformClick();
                //关闭工程
                CloseProject();
                myProjectPath = "";
            }

            foreach (EditWin m_edit in drawToolWindow.editWinList)
            {
                m_edit.Close();
            }
            drawToolWindow.editWinList.Clear();

            FormNewProject proj = new FormNewProject();

            if (proj.ShowDialog() == DialogResult.OK)
            {
                string ProjPath   = proj.projPath;
                string myProjName = proj.projName;
                string s          = ProjPath.Substring(ProjPath.Length - 1, 1);
                if (s == "\\")
                {
                    myProjectPath     = ProjPath + myProjName + "\\";
                    myProjectFullName = myProjectPath + myProjName + ".mproj";
                }
                else
                {
                    myProjectPath     = ProjPath + "\\" + myProjName + "\\";;
                    myProjectFullName = myProjectPath + myProjName + ".mproj";
                }
                DirectoryInfo dir = new DirectoryInfo(myProjectPath);
                dir.Create();
                //bDirty = true;
                drawToolWindow.myProjectFullName = myProjectFullName;
                drawToolWindow.myProjectPath     = myProjectPath;
                XmlDocument doc = new XmlDocument();
                doc.LoadXml("<MProj></MProj>");
                doc.Save(myProjectFullName);
            }
        }
Exemple #7
0
        private void Form1_FormClosing(object sender, FormClosingEventArgs e) // closing SW
        {
            if (first == true)                                                // if connection still on send Stop command
            {
                sensport.Write(StpData);
            }
            Plothandle = true;
            if (LogScreen.Text != string.Empty)        // if there is data ask for save
            {
                DialogResult result1 = MessageBox.Show("Do you want to save the data before exit?", "Save Data", MessageBoxButtons.YesNo);

                if (result1 == DialogResult.Yes)
                {
                    SaveButton.PerformClick();
                }
            }
        }
Exemple #8
0
 private void EditorForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         Clipper.Terminate();
     }
     if (e.KeyCode == Keys.Z && e.Modifiers == Keys.Control && UndoToolStripButton.Enabled)
     {
         UndoToolStripButton.PerformClick();
     }
     if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control)
     {
         ClipboardBbutton.PerformClick();
     }
     if (e.KeyCode == Keys.S && e.Modifiers == Keys.Control)
     {
         SaveButton.PerformClick();
     }
 }
Exemple #9
0
 private void SaveTButton_Click(object sender, EventArgs e)
 {
     SaveButton.PerformClick();
 }
Exemple #10
0
 private void SaveAndExitClick(object sender, EventArgs e)
 {
     isAlive = false;
     SaveButton.PerformClick();
 }
Exemple #11
0
 //退出按钮
 private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SaveButton.PerformClick();//save and exit
     this.Close();
 }