|
-
Oct 6th, 2009, 10:06 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] What's more efficient?
Say I have two buttons on a form. Both buttons perform relatively the same function, which is displaying a Modal Dialog form. However, each button sends a different set of parameters to the Dialog form to perform different actions.
So, my question is this. Is it more efficient to have one click event handle both buttons (using sender to determine which button was pressed to send the appropriate parameters), or is it better to have two click events (one for each button). I guess another question would be, is there a difference at all?
I know it might look a little cleaner to have one event handling both buttons, would make it a tiny bit easier to modify the code in the future since both buttons would be in the same spot, but is there any advantages to using one method over the other?
This is more for personal knowledge then anything as I personally can't see any performance gain from using one event handler over two.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|