示例#1
0
        private void frmAvisoPregunta_KeyUp(object sender, KeyEventArgs e)
        {
            if (this.tipo == "")
            {
                p.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    p.btn1_Click(null, null);
                }

                if (e.KeyCode == Keys.Right)
                {
                    p.btn2.Focus();
                }
            }

            if (this.tipo == "informacion")
            {
                informacion.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    informacion.button1_Click(null, null);
                }
            }

            if (this.tipo == "exclamation")
            {
                exclamation.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    exclamation.btn1_Click(null, null);
                }
            }

            if (this.tipo == "error")
            {
                error.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    error.btn1_Click(null, null);
                }
            }

            if (this.tipo == "success")
            {
                success.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    success.btn1_Click(null, null);
                }
            }

            if (this.tipo == "question")
            {
                question.Focus();
                if (e.KeyCode == Keys.Enter)
                {
                    question.btn1_Click(null, null);
                }

                if (e.KeyCode == Keys.Right)
                {
                    question.button1.Focus();
                }
            }
        }