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 ?

Recommended Answers

All 4 Replies

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";
}
commented: :P the question is for adding 1500 to the charge if male is selected. Also how you find the female charge 1000? +0

I have showed you an example in some other of your thread!!

got it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.