|
I've
recently attempted to do a project using radio buttons in which i have
abandoned and picked up a new method of achieving a goal. I am
currently trying to figure out how a combo box works so i can use it
within my application. I've searched through my C# steps by steps book
and haven't found anything i can understand yet about combo box
statements. If anyone has any reference information about combo box I'd
greatly appreciate it.
Also, the statement I'm trying to do
involves values already ready inputted in the combo box with the edit
button. The best example I know to how describe it is with a
calculator example. As if the my code reads "Addition" = true, then
a+b=c. O_o something like that, and if combo box was = to
"Substitution" then a-b=c. Thanks again!
Some more code information i was working on. The build was successful but didn't do what i wanted, and i was hoping someone could correct my errors for me. Thanks!
private void button1_Click(object sender, EventArgs e) { if (comboBox1.Text == "Two hand Axe") {double str = double.Parse(lhsoperant.Text); double dex = double.Parse(rhsoperant.Text); double wpn = double.Parse(mhsoperant.Text); double ma = double.Parse(frhsoperant.Text); double outcome; outcome = (str * .57) + (dex * .3) + (wpn * 1.0); outcome2 = outcome * ma; double outcome2 = outcome; double outcome3; outcome3 = (str * .38) + (dex * .4) + (wpn * .7); double outcome4 = outcome3; outcome4 = outcome3 * ma; resultmin.Text = outcome4.ToString(); resultmax.Text = outcome2.ToString();} }
It builds successful but in the windows form it does nothing. Before i inputted the combo box the application worked out the code, but with the combo box, even when "Two hand Axe" is true it does nothing when i activate the event "button1_Click". What i want it to do is run this code when i do the event "button1_click". thanks
|