Exemplo n.º 1
0
 private void txtboxMessage_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         BtnSend.PerformClick();
     }
 }
Exemplo n.º 2
0
 // Hit ENTER to send message
 private void TxtChatUzenet_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter && TxtChatMessage.Text != string.Empty)
     {
         BtnSend.PerformClick();
         e.Handled = true;
     }
 }
Exemplo n.º 3
0
        //定时器事件
        private void Timer_Tick(object sender, EventArgs e)
        {
            string strsecond = TB_SentTime.Text;

            try
            {
                int isecond = int.Parse(strsecond);
                Timer.Interval = isecond;
                if (Timer.Enabled == true)
                {
                    BtnSend.PerformClick();
                }
            }
            catch (Exception)
            {
                Timer.Stop();  //停止定时器
                MessageBox.Show("打开定时器失败", "错误提示");
            }
        }