mathieu_cupryk
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(onButtonActio n));
b.clicked = True;
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Button b = new Button(new EventHandler(onButtonActio n));
b.clicked(1);
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButto nAction);
b.clicked(1);
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButto nAction);
b.clicked = True;
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(onButtonActio
b.clicked = True;
--------------------------
Button b = new Button(new EventHandler(onButtonActio
b.clicked(1);
--------------------------
Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButto
b.clicked(1);
--------------------------
Button b = new Button();
b.ButtonClick += new ButtonEventHandler(onButto
b.clicked = True;
None of the above.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.