TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
K S Reddi Prasad
NA
28
75.1k
How to put multiple events code in a single event
Apr 1 2011 7:21 AM
Hi all,
I am coding an c#.net application, where i have multiple events for multiple buttons. Now, I wanted to put all that code in a single event and i have to work as it was working previously. Can i use a switch case inside the Event???
Here is the sample code of multiple events:
if (button.SelectSingleNode("ButtonId").InnerText == "btnRefresh")
rButton.Click += new EventHandler<RibbonControlEventArgs>(btnRefresh_Click);
else if (button.SelectSingleNode("ButtonId").InnerText == "btnSaveToVGF")
rButton.Click += new EventHandler<RibbonControlEventArgs>(btnSaveToVGF_Click);
else if (button.SelectSingleNode("ButtonId").InnerText == "btnSubmit")
rButton.Click += new EventHandler<RibbonControlEventArgs>(btnSubmit_Click);
Now, I want to work on a single event and That event should handle all these events code. I mean all the code in btnRefresh_Click, btnSaveToVGF_Click, btnSubmit_Click into a single event button_click. so when i click this any button, this event should be handled and appropriate action should be taken using switch case.
Any help would be greatly appreciated.
Thanks & Regards,
K.S.Reddi Prasad.
Reply
Answers (
3
)
How do you parse a soap Message with c# .net link
Error load audio from sql to Datagridview