コード例 #1
0
        private void frmMain_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                this.Hide();
                break;

            case Keys.Space:
                IsSpacePressed = true;
                break;

            case Keys.Escape:
                if (ScreenZoom)
                {
                    ZoomScreen(false);
                }
                else
                {
                    this.Hide();
                    frmShow = false;
                }
                break;

            case Keys.H:
                drawStyle = DrawStyle.FreeHand;
                break;

            case Keys.L:
                drawStyle = DrawStyle.Line;
                break;

            case Keys.R:
                drawStyle = DrawStyle.Rectangle;
                break;

            case Keys.C:
                drawStyle = DrawStyle.Circle;
                break;

            case Keys.D1:
                pen.Color = Color.Red;
                break;

            case Keys.D2:
                pen.Color = Color.Blue;
                break;

            case Keys.D3:
                pen.Color = Color.Green;
                break;

            case Keys.D4:
                pen.Color = Color.Gold;
                break;

            case Keys.D5:
                pen.Color = Color.White;
                break;

            case Keys.D6:
                pen.Color = Color.Black;
                break;

            case Keys.F1:
                Help hlp = new Help();
                hlp.ShowDialog();
                break;
            }
        }