메뉴 건너뛰기

Programing

C# 게시판

콤보박스로 구구단 구현하기

관리자2 2018.12.24 19:55 조회 수 : 169

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 ts7

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void cbbGuGu_SelectedIndexChanged(object sender, EventArgs e)

        {

            txtGuGu.Clear();

            var s = cbbGuGu.Text.Split();

            for (var i = 1; i < 10; i++)

            {

                txtGuGu.Text += s[0] + "*" + i + "=" + (Convert.ToInt32(s[0]) * i)+"\r\n";

            }

        }

    }

}

콤보박스를 열어 단을 클릭하면 알맞은 숫자가 출력된다.
위로