메뉴 건너뛰기

Programing

C# 게시판

메뉴관리 폼

관리자 2018.12.30 14:42 조회 수 : 175

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void 새로만들기toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            this.lblResult.Text = this.새로만들기toolStripMenuItem.Text;
           
        }

        private void 닫기toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            this.lblResult.Text = this.toolStripMenuItem2.Text;
            ControlClear();
            this.toolStripMenuItem2.Checked = true;
            this.lblResult.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
        }

        private void ControlClear()
        {
            this.toolStripMenuItem2.Checked = false;
            this.toolStripMenuItem3.Checked = false;
            this.toolStripMenuItem4.Checked = false;
        }

        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            this.lblResult.Text = this.toolStripMenuItem3.Text;
            ControlClear();
            this.toolStripMenuItem3.Checked = true;
            this.lblResult.Font = new System.Drawing.Font("굴림", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
        }

        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {
            this.lblResult.Text = this.toolStripMenuItem4.Text;
            ControlClear();
            this.toolStripMenuItem4.Checked = true;
            this.lblResult.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
        }

        private void 닫기ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void toolStripTextBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (this.toolStripTextBox1.Text != "" && e.KeyChar == (char)13)
            {
                e.Handled = true;
                this.lblResult.Text = this.toolStripTextBox1.Text;
            }
        }
    }
}
메뉴와 우클릭메뉴로 입력을 받아 가운데 텍스트로 내보낸다.

위로