•      Sign In
• Create Account

### #ActualBCullis

Posted 14 December 2012 - 08:27 AM

Try replacing
myButton.Click += new Action(myButton_Click);
with
myButton.Click += myButton_Click;
or
myButton.Click += () => {Console.Write("foo");};

From what I can tell in the MSDN article, the constructor format of Action doesn't do what you're thinking it does. I'll gladly take some correction on that if I didn't search deep enough though.

### #2BCullis

Posted 14 December 2012 - 08:27 AM

Try replacing
myButton.Click += new Action(myButton_Click);
with
myButton.Click += myButton_Click;
or
myBuitton.Click += () => {Console.Write("foo");};

From what I can tell in the MSDN article, the constructor format of Action doesn't do what you're thinking it does. I'll gladly take some correction on that if I didn't search deep enough though.

### #1BCullis

Posted 14 December 2012 - 08:27 AM

Try replacing
myButton.Click += new Action(myButton_Click);
with
myButton.Click += myButton_Click;
or
[code=auto:0]myBuitton.Click += () => {Console.Write("foo");};

From what I can tell in the MSDN article, the constructor format of Action doesn't do what you're thinking it does. I'll gladly take some correction on that if I didn't search deep enough though.

PARTNERS