c# - Cannot assign to 'click' because it is a 'method group' -


i'm using linux monodevelop c# stuff , wrong ?

?

using system; using gtk;  namespace aaadd {     class mainclass     {         public static void main (string[] args)         {             application.init ();             mainwindow win = new mainwindow ();             button button = new button();              button.click += new eventhandler (button_click);             win.add (button);             button.show ();             win.show ();              application.run ();         }         public static void button_click(object sender, system.eventargs e)          {          }      } } 

error :

cannot assign 'click' because 'method group'

to subscribe event need use

button.clicked += new eventhandler (button_click); 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -