Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling an event
Message
 
To
01/04/2002 09:51:25
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00639429
Message ID:
00639450
Views:
17
Hi Randy,

Good design says that events should only be called in response to the event they are handling. If you have some code that needs to run in response to a command button click AND in response to something else you should move the code to its own method and call that from the Click() event and from wherever else it is you want to call it from.

That said, 'sender' is a reference to the object that fired the event and System.EventArgs is a generic event arguments object for events that don't need specific arguments (like Control key, Shift key, mouse button down, etc). You could call it like:

cmdButton.Click(me, new System.EventArgs)

HTH,
R--

>hello all, i have a quick question. can i call the click event of a command button in VB.NET? In VFP, it is very simple - cmdButton.Click(); however, in VB.NET you it seems you have to add the parameters (sender, system.eventargs). I really don't understand what I am supposed to be sending. Can anyone give me some direction on this or am I going about this the wrong way by just using the statement - me.cmdButton.Click(send, eventargs)? Thanks for the help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform