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)
{
}
}
}
여기까지 했는데 사용자 기능구현을 위해 콤마를 추가했는데
이 콤마때문에 돈들이 계산이 안되요 ....저렇게 하면안되는건가요?
방법좀알고싶습니다!!