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
Post a Comment