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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only