Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

Buttons?

You want to accomplish the following with a Button Control:

1.) Add the Button
2.) Add the Event Handler
3.) Trigger the event

Which would be the correct segment of code to accomplish these tasks?
Button b = new Button(new EventHandler(onButtonAction));
b.clicked = True;
 
 
--------------------------------------------------------------------------------
 
  Button b = new Button(new EventHandler(onButtonAction));
b.clicked(1);
 
 
--------------------------------------------------------------------------------
 
  Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButtonAction);
b.clicked(1);
 
 
--------------------------------------------------------------------------------
 
  Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButtonAction);
b.clicked = True;
 
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

None of the above.
ASKER CERTIFIED SOLUTION
Avatar of Raynard7
Raynard7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Button does not have any contsructor that takes an argument, nor does it have any property, method or event called ButtonClick or clicked;
Ah, unless this is some fantasy Button control you have written yourself in which case it could be either of the last two options depending on how you had written the control.