Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Configure EventHandler with string

Posted on 2008-06-19
4
Medium Priority
?
411 Views
Last Modified: 2013-12-16
Hi EE's

I'm facing following problem. I have to configure the EventHandler of a ToolStripButton with a string (or any other object) coming from a XML. How can I give the corresponding dll, class and function to the EventHandler?

An example:
I have a dll called MyOwnMenu.dll
In this dll I have a class called MyMenuItem1
In this class I have a (static) function called MyToolStripCall
In my main application I add an ToolStripButton
ToolStripButton myMenuButton = new ToolStripButton("myText", null, new EventHandler(XXX));

"myText" comes out of a XML and also the function to call (XXX) should be named in the xml.

Thanks a lot!
0
Comment
Question by:Bruce_1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:elimesika
ID: 21824057
0
 
LVL 6

Author Comment

by:Bruce_1975
ID: 21824655
Hi elimesika,
the reflection stuff is not really new to me. What I'm looking for is a solution to give a function to an event handler. Do I have to call a Callback function and access the target function from there?
Or is there an other way to directly call the function from the event handler?

Regards,
Bruce
0
 
LVL 19

Accepted Solution

by:
elimesika earned 2000 total points
ID: 21828894
HI

I don't see any other option except constructing a string with DLL, class name, method and call it using reflection.

0
 
LVL 6

Author Closing Comment

by:Bruce_1975
ID: 31468810
Thanks for your help.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question