I have an attachment below to show you how my program should work.
How do I add 1500 to the textbox that shows the total amount to be charged if male is selected in the gender combobox ?
I have an attachment below to show you how my program should work.
How do I add 1500 to the textbox that shows the total amount to be charged if male is selected in the gender combobox ?
if (ComboBox1.SelectedItem.ToString() == "Male")
{
int amount = 0;
if (TextBox1.Text == "")
{
TextBox1.Text = "0";
}
amount = Convert.ToInt32(TextBox1.Text) + 1500;
TextBox1.Text = amount.ToString();
}
In Combobox selectedindex_changed event use following code
if(combobox1.value=="Male")
{
Textbox1.Text="1500";
}
else
{
Textbox1.Text="1000";
}
I have showed you an example in some other of your thread!!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.