Exemplo n.º 1
0
        /// <summary>
        /// 将结果设定到父页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listBox_jbzd_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                //回车选中
                if (e.KeyCode == Keys.Enter)
                {
                    sysCommonForm owerForm = (sysCommonForm)this.Owner;
                    owerForm.setTextToText(text, listBox_com.SelectedValue.ToString() + "|" + listBox_com.Text);
                    //this.Close();
                }

                if (e.KeyCode == Keys.Escape || e.KeyCode == Keys.Space)
                {
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                this.Close();
            }
        }
Exemplo n.º 2
0
        private void listBox_com_DoubleClick(object sender, EventArgs e)
        {
            sysCommonForm owerForm = (sysCommonForm)this.Owner;

            owerForm.setTextToText(text, listBox_com.SelectedValue.ToString() + "|" + listBox_com.Text);
        }