Ejemplo n.º 1
0
        private void btnNewBrick_Click(object sender, EventArgs e)
        {
            this.isFileModified = true;

            this.toolStripStatusLabel.Text = " Choose the position for the new brick. Press 'Esc' to cancel.";
            this.eStatus = eFormStatus.CreatingItem;
            this.Cursor  = Cursors.No;
        }
Ejemplo n.º 2
0
 private void frmMain_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Escape && eStatus == eFormStatus.CreatingItem)
     {
         this.eStatus = eFormStatus.Normal;
         this.Cursor  = Cursors.Default;
         this.toolStripStatusLabel.Text = "";
     }
     else if (e.KeyData == Keys.Delete && eStatus == eFormStatus.Normal)
     {
         foreach (Control control in this.Controls["pnlGame"].Controls)
         {
             if (control.Focused)
             {
                 this.Controls["pnlGame"].Controls.Remove(control);
             }
         }
     }
     else if (e.KeyData == (Keys.Control | Keys.N))
     {
         btnNewBrick_Click(null, null);
     }
 }