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 WindowsFormsApplication2
{


    public partial class Form1 : Form
    {

        bool flag = true;
        string fst_money;
        public Form1() 
        {
            InitializeComponent();
        }

        private void 총급여액_입력(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                string lgsText;
                lgsText = textBox1.Text.Replace(",", "");//숫자변환시 콤마로 발생하는 에러 방지
                textBox1.Text = String.Format("{0:#,###}", Convert.ToInt64(lgsText));//천 단위 찍어주기
                textBox1.SelectionLength = 0;
                this.textBox1.ImeMode = ImeMode.Disable;//한글 영어입력 배제

            }

        }
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back)))
            { //키를 조사해서 숫자만입력 !을 없애만 문자만 입력 받게된다.
                e.Handled = true;
            }
        }
        private void next_textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                string money;
                long fst_money;
                money = textBox1.Text.Replace(",", "");
                fst_money=Convert.ToInt64(money);

                //long fst_money = Convert.ToInt64(textBox1.Text);
               
               
                if(fst_money<5000000)
                {
                    fst_money=fst_money*(70/100);
                    textBox2.Text = String.Format("{0:#,###}", fst_money);
                    textBox2.SelectionLength = 0;
                  
                }
                else if(fst_money>5000000 && fst_money<=15000000)
                {
                    fst_money = 3500000 + ((fst_money - 5000000) * (15 / 100));
                }
                else if(fst_money>15000000 && fst_money<=45000000)
                {
                    fst_money = 7500000 + ((fst_money - 15000000) * (5 / 100));
                }
                else if(fst_money>45000000 && fst_money<=100000000)
                {
                    fst_money = 12000000 + ((fst_money - 15000000) * (5 / 100));
                }
                else
                {
                    fst_money = 14500000 + ((fst_money - 100000000) * (2 / 100));
                }
             


            }
        }

        private void 근로소득공제(object sender, EventArgs e)
        {
           
           
           
        }
 
      

        /*private void button1_Click(object sender, EventArgs e)
        {
            if (flag)
            {
                ClientSize = new System.Drawing.Size(400, 321);
                flag = false;

            }
            else
            {
                ClientSize = new System.Drawing.Size(877, 321);
                flag = true;

            }
        }*/

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {

        }

       
      
      
    }
}


여기까지 했는데 사용자 기능구현을 위해 콤마를 추가했는데

이 콤마때문에 돈들이 계산이 안되요 ....저렇게 하면안되는건가요?

방법좀알고싶습니다!!

No. Subject Author Date Views
Notice SQL강좌: 챗GPT와 함께 배우는 SQL Server 무료 강좌 목차와 소개 (2023년 9월 업데이트) 코난(김대우) 2023.08.18 974
Notice Python 무료 강좌 - 기초, 중급, 머신러닝(2023년 6월 업데이트) 코난(김대우) 2021.01.01 1635
84 깜빡임 효과 주는 방법 문의 [1] 방자 2017.02.08 6069
83 인터넷 실행 후알유? 2016.12.12 5847
82 for문 사용방법 문의 [2] 방자 2016.10.27 6777
81 FileStream 사용 시 오류사항 문의 Lauren 2016.09.01 6363
80 웹응용프로그램 프로젝트 열기 문의 hoonsik.kong 2016.06.13 7532
79 MySql과 LINQ to SQL 클래스를 사용하는 중입니다. 문제가 있어서 질문드립니다. [3] 적신 2016.04.26 25039
78 웹으로 데이터 전송 관련 질문드립니다. [1] 란다 2016.03.25 9042
77 C# vs2005 컴파일 시 자꾸 오류팝업창이뜹니다..도와주세요.. [1] 아배고파젠장 2016.03.22 8593
76 asp.net mvc에서 액션 메소드에 권한 할당 관련 비타민c 2016.02.24 6735
75 xml Deserialization 이유진_301818 2015.12.06 7974
74 개발 방향 및 방식에 대한 조언이 필요합니다. [2] 이현정_304053 2015.11.09 8914
73 소수점 처리 문의 입니다. 우영호수 2015.10.13 6665
» 연말정산하는 폼하나 만드는데 막혀서 질문드립니다 ㅠㅠ 눈류 2015.06.04 9005
71 C# using System.Drawing; 질문 desks 2015.04.06 8437
70 C# 동적으로 추가된 datagridview에 row를 추가하는 방법 질문합니다. AutoCad 2014.12.23 13009
69 Linq to SQL예외 문의 호호 2014.12.23 9901
68 IIS 관련 고수조 2014.11.24 7922
67 c# 과 mssql 에서의 real type 은 어떻게 사용해야 하는지요? [1] 송광호 2014.09.22 9272
66 Windows7 64bit 에서의 visual studio 2003 설치 문의 쿨키이드 2014.06.18 10519
65 윈폼 이미지 강낭콩 2014.06.01 9150





XE Login