Reputation: 1496
An Example:
class SpecialButton
{
public SpecialButton(ButtonConfig conf, Method definedMethod)
{
button = new Button();
button.Location = conf.Location;
//etc.
button.Click += new System.EventHandler(definedMethod);
}
}
is it possible to define a variable as method? I want to use the delegate for this click event, which comes from outside of this class.
Thank You.
Upvotes: 1
Views: 125
Reputation: 4683
ok,read articles about delegates Delegates Tutorial on MSDN and Introduction to Delegates and Events
Upvotes: 1