namespace Zau_TextChangedEvent
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//display all textboxes
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
textBox4.Enabled = false;
textBox5.Enabled = false;
textBox6.Enabled = false;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
textBox1.Enabled = true;
textBox4.Enabled = true;
}
else
{
textBox1.Enabled = false;
textBox4.Enabled = false;
textBox1.Clear();
textBox4.Clear();
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
int q;
int.TryParse(textBox1.Text, out q);
decimal subt1 = q * 4.99m;
textBox4.Text = subt1.ToString("c");
}
}
}

No comments:
Post a Comment