By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

Object sender, System.EventArgs e

P: n/a
I'm trying to call ButtonClick( object sender, System.EventArgs e) from a
method rather than clicking the button. But I can't determine the values of
sender and e that I should use. I ran the program with a stop on, clicked
the button and opened up a watch window and it shows them as
System.Windows.Forms.MenuItem and System.EventArgs with all their
attributes.

My question is how do I determine the proper values of sender and e that I
can use to call ButtonClick(sender, e) ?

Thanks for your time, J e r
Sep 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"J e r" <mi*****@localnet.comwrote in message
news:13*************@corp.supernews.com...
I'm trying to call ButtonClick( object sender, System.EventArgs e) from a
method rather than clicking the button. But I can't determine the values
of
sender and e that I should use. I ran the program with a stop on, clicked
the button and opened up a watch window and it shows them as
System.Windows.Forms.MenuItem and System.EventArgs with all their
attributes.

My question is how do I determine the proper values of sender and e that I
can use to call ButtonClick(sender, e) ?
In most cases:

ButtonClick(null, EventArgs.Empty)

will work just fine. If you actually use the sender parameter inside the
handler, you'll have to either provide the right control or else write the
handler to check for null and then avoid using sender.
>
Thanks for your time, J e r


Sep 10 '07 #2

P: n/a

"J e r" <mi*****@localnet.comwrote in message
news:13*************@corp.supernews.com...
I'm trying to call ButtonClick( object sender, System.EventArgs e) from a
method rather than clicking the button. But I can't determine the values
of
sender and e that I should use. I ran the program with a stop on, clicked
the button and opened up a watch window and it shows them as
System.Windows.Forms.MenuItem and System.EventArgs with all their
attributes.

My question is how do I determine the proper values of sender and e that I
can use to call ButtonClick(sender, e) ?
oops, this is C++/CLI group

that should have been nullptr and EventArgs::Empty
>
Thanks for your time, J e r


Sep 10 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.