336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

목표 :

mini 계산기를 만들어 본다.

 

소스코드 : 

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 WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            this.textNum1.Text = "";
            this.textNum2.Text = "";
            this.textResult.Text = "";
            this.lbResult.Text = "Ready";
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            double num1 = double.Parse(this.textNum1.Text);
            double num2 = double.Parse(this.textNum2.Text);
            double num = num1 + num2;
            this.textResult.Text = num.ToString();
            this.lbResult.Text = "+";
        }
        private void btnClear_Click(object sender, EventArgs e)
        {
            this.textNum1.Text = "";
            this.textNum2.Text = "";
            this.textResult.Text = "";
            this.lbResult.Text = "Ready";
        }
    }
}

 

결과 :

'Programing C# > C# 200' 카테고리의 다른 글

005 C# 윈도우 프로그래밍 발전  (0) 2020.01.08
003 C# 윈도우 프로그래밍  (0) 2020.01.06
001 C# 프로그래밍 시작하기.  (0) 2019.04.19

+ Recent posts