コード例 #1
0
        protected override void OnMouseEnter(System.EventArgs e)
        {
            newBtnColor   = new Color();
            m_bIsRunnning = true;
            int i = 215;

            sw1.Reset();
            sw1.Start();

            while (sw1.ElapsedMilliseconds < lTimeToPress && m_bIsRunnning == true)
            {
                Thread.Sleep(10);
                newBtnColor = Color.FromArgb(255, i, i);
                Application.DoEvents();
                this.BackColor = newBtnColor;
                i--;
            }

            if (m_bIsRunnning == true)
            {
                this.BackColor = Color.LightGreen;
                m_frmTop.SendChar(this.KeyValue);
                //SendKeys.Send(this.KeyValue);
            }
        }
コード例 #2
0
 private void btn0_Click(object sender, EventArgs e)
 {
     m_frmTop.SendChar("0");
 }