Exemplo n.º 1
0
        /// <summary>
        /// 図形モードをクリックしたとき
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnShapeMode_Click(object sender, EventArgs e)
        {
            m_modeDialog = new ShapeModeDialog2();
            if (m_modeDialog.ShowDialog() == DialogResult.OK)
            {
                m_shapeMode = (ShapeMode)Properties.Settings.Default.SHAPE_MODE_INDEX;
            }

            for (int i = 0; i < TsmiShapeMode.DropDownItems.Count; i++)
            {
                ToolStripMenuItem item = TsmiShapeMode.DropDownItems[i] as ToolStripMenuItem;
                item.Checked = false;
            }
            //チェックを付ける
            switch (m_shapeMode)
            {
            case ShapeMode.Circle:
                TsmiCircle.Checked = true;
                break;

            case ShapeMode.Square:
                TsmiSquare.Checked = true;
                break;

            case ShapeMode.StraightLine:
                TsmiStraightLine.Checked = true;
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 図形モードの閉じるときのイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ModeDialog_FormClosing(object sender, FormClosingEventArgs e)
        {
            ShapeModeDialog2 modeDialog = (ShapeModeDialog2)sender;

            m_modeDialog = modeDialog;

            m_shapeMode = (ShapeMode)Properties.Settings.Default.SHAPE_MODE_INDEX;

            //初期化
            for (int i = 0; i < TsmiShapeMode.DropDownItems.Count; i++)
            {
                ToolStripMenuItem item = TsmiShapeMode.DropDownItems[i] as ToolStripMenuItem;
                item.Checked = false;
            }
            //チェックを付ける
            switch (m_shapeMode)
            {
            case ShapeMode.Circle:
                TsmiCircle.Checked = true;
                break;

            case ShapeMode.Square:
                TsmiSquare.Checked = true;
                break;

            case ShapeMode.StraightLine:
                TsmiStraightLine.Checked = true;
                break;
            }
        }