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...
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 19, 2018, 2:45 AM EDT
Kristine Legzdiņa31 reputationPosted Apr 19, 2018, 4:30 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 19, 2018, 5:14 AM EDT
Kristine Legzdiņa31 reputationPosted Apr 19, 2018, 5:26 AM EDT
Kristine Legzdiņa31 reputationPosted Apr 19, 2018, 10:07 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 19, 2018, 11:00 PM EDT
Rafnas T PRank #280 · 8.8K reputationPosted Apr 19, 2018, 5:09 AM EDT
Kristine Legzdiņa31 reputationPosted Apr 19, 2018, 10:29 PM EDT
Kristine Legzdiņa31 reputationPosted Apr 20, 2018, 2:59 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts