Kristine Legzdiņa

Kristine Legzdiņa

  • 1.9k
  • 21
  • 294

combobox value pass as a parameter

Apr 19 2018 4:44 AM
user select first combobox value, then select second combobox value. Then when he precc Button i need to pass these double type values to method as a parameters.
 
im new in c# and this is part of home work. I need to create delegate.
 
part of code looks like:
 
i create delegate.
 
public delegate double operation(double x, double y);
 
i create class with one simple method.
 
public class Program
{
internal static double Addition(double a, double b)
{
return a + b;
}
}
 
then i create object
 
operation obj = new operation(Program.Addition);
textBox1.Text = (obj( comboxox1Value, comboxox2Value));
 
for now it seems to me, i will never become a programmer...

Answers (9)