7
Reply

Adding events at run time

Lewis

Lewis

Jan 20 2010 8:58 AM
4.3k

Hi, ive been working on an application and im starting to struggle to get much further at the moment. What i'm trying to do is list within a menustrip the folder in a set location and the files within them at run time, then when a file is clicked it opens the file, i would also like to add a mouse hover event for each, for example:

File Menu
Folder A > File A
                 File B

Folder B > File C
                 File D

Etc
I've been able to get this far and the menu and menu items are created at run time. The problem is that im not sure how to add the event for each file (if it can be done?). I've seen an example on MSDN of how to it but that was only for one item. I've had a look on a few websites and read a couple of posts about using an array?

I'm not very sure how to go about achieving this, or what more to read about, any help would be much appreciated.

Thanks

Answers (7)