protected override bool ProcessDialogKey(Keys keyData) { switch (keyData) { case Keys.Escape: Close(); return(true); case Keys.Back: categoryListView.Focus(); return(true); case Keys.Return: if (SelectedCodeGenerator != null) { if (categoryListView.Focused && SelectedCodeGenerator.Content.Count > 0) { selectionListBox.Focus(); } else { Close(); SelectedCodeGenerator.GenerateCode(textEditorControl.ActiveTextAreaControl.TextArea, selectionListBox.CheckedItems.Count > 0 ? (IList)selectionListBox.CheckedItems : (IList)selectionListBox.SelectedItems); } return(true); } else { return(false); } } return(base.ProcessDialogKey(keyData)); }
private void GeneratorForm_Load(object sender, System.EventArgs e) { foreach (string str in Enum.GetNames(typeof(TargetFramework))) { cboTarget.Items.Add(str); } LoadInfo(); LoadObjects(); clbObjects.Focus(); }
private bool kiemtra() { if (viettat.Text == "") { viettat.Focus(); return(false); } if (ten.Text == "") { ten.Focus(); return(false); } else { ten.Text = ten.Text.Replace("(", "["); ten.Text = ten.Text.Replace(")", "]"); } if (makp.SelectedIndex == -1) { makp.Focus(); return(false); } if (kehoach.Text == "") { kehoach.Text = "0"; } if (thucke.Text == "") { thucke.Text = "0"; } s_maba = ""; int j; for (int i = 0; i < dmba.Items.Count; i++) { if (dmba.GetItemChecked(i)) { j = i + 1; s_maba += j.ToString().PadLeft(2, '0') + ","; } } if (s_maba == "" && ma.Text != "99") { MessageBox.Show(lan.Change_language_MessageText("Chọn bệnh án sử dụng trong khoa !"), LibMedi.AccessData.Msg); dmba.Focus(); return(false); } else { s_maba = (s_maba == "")?"01":s_maba.Substring(0, s_maba.Length - 1); } return(true); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void checkBox1_CheckedChanged(object sender, System.EventArgs e) { cklPurview.Focus(); if (checkBox1.Checked == true) { for (int i = 0; i < cklPurview.Items.Count; i++) { cklPurview.SetItemChecked(i, true); } } else { for (int i = 0; i < cklPurview.Items.Count; i++) { cklPurview.SetItemChecked(i, false); } } }
private bool kiemtra() { if (ten.Text == "") { ten.Focus(); return(false); } s_kho = ""; for (int i = 0; i < kho.Items.Count; i++) { if (kho.GetItemChecked(i)) { s_kho += dtkho.Rows[i]["id"].ToString().Trim() + ","; } } if (s_kho == "") { MessageBox.Show( lan.Change_language_MessageText("Yêu cầu chọn kho !"), d.Msg); kho.Focus(); return(false); } s_nguon = ""; for (int i = 0; i < nguon.Items.Count; i++) { if (nguon.GetItemChecked(i)) { s_nguon += dtnguon.Rows[i]["id"].ToString().Trim() + ","; } } s_madoituong = ""; for (int i = 0; i < madoituong.Items.Count; i++) { if (madoituong.GetItemChecked(i)) { s_madoituong += dtdt.Rows[i]["madoituong"].ToString().Trim() + ","; } } return(true); }
private void frmVitalGroup_Load(object sender, System.EventArgs e) { chklstGroup.Focus(); }
private void m_clbUtilities_SelectedIndexChanged(object sender, System.EventArgs e) { System.Drawing.Font currentFont = m_rtbDescription.SelectionFont; #if __MonoCS__ // Creating the bold equivalent of the current font doesn't seem to work in Mono, // as we crash shortly due to failures in GDIPlus.GdipMeasureString() using that // font. var boldFont = currentFont; #else System.Drawing.FontStyle boldFontStyle = FontStyle.Bold; using (System.Drawing.Font boldFont = new Font(currentFont.FontFamily, currentFont.Size, boldFontStyle)) #endif { ((IUtility)m_clbUtilities.SelectedItem).OnSelection(); m_rtbDescription.Clear(); // What m_rtbDescription.SelectionFont = boldFont; m_rtbDescription.AppendText(FwCoreDlgs.ksWhatItDoes); m_rtbDescription.AppendText(Environment.NewLine); m_rtbDescription.SelectionFont = currentFont; if (string.IsNullOrEmpty(m_whatDescription)) { m_rtbDescription.AppendText(FwCoreDlgs.ksQuestions); } else { m_rtbDescription.AppendText(m_whatDescription); } m_rtbDescription.AppendText(string.Format("{0}{0}", Environment.NewLine)); // When m_rtbDescription.SelectionFont = boldFont; m_rtbDescription.AppendText(FwCoreDlgs.ksWhenToUse); m_rtbDescription.AppendText(Environment.NewLine); m_rtbDescription.SelectionFont = currentFont; if (string.IsNullOrEmpty(m_whenDescription)) { m_rtbDescription.AppendText(FwCoreDlgs.ksQuestions); } else { m_rtbDescription.AppendText(m_whenDescription); } m_rtbDescription.AppendText(string.Format("{0}{0}", Environment.NewLine)); // Cautions m_rtbDescription.SelectionFont = boldFont; m_rtbDescription.AppendText(FwCoreDlgs.ksCautions); m_rtbDescription.AppendText(Environment.NewLine); m_rtbDescription.SelectionFont = currentFont; if (string.IsNullOrEmpty(m_redoDescription)) { m_rtbDescription.AppendText(FwCoreDlgs.ksQuestions); } else { m_rtbDescription.AppendText(m_redoDescription); } #if __MonoCS__ // If we don't have a selection explicitly set, we will crash deep in the Mono // code (RichTextBox.cs:618, property SelectionFont:get) shortly. m_rtbDescription.Focus(); m_rtbDescription.SelectionStart = 0; m_rtbDescription.SelectionLength = 0; m_clbUtilities.Focus(); #endif } }