Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / July 2003

Tip: Looking for answers? Try searching our database.

Events in dynamic loaded assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Falta - 13 Jul 2003 10:30 GMT
Hi all,

I need a help with following problem. I need to create a menu from dynamic
loaded assembly on the main form of my application. The menu is created
succesfully, but the events of this menu, which are defined in the dynamic
loaded assembly, are not raised. How can I raise them?

Martin

---
Odchoz? zpr?va neobsahuje viry.
Zkontrolov?no antivirov?m syst?mem AVG (http://www.grisoft.cz).
Verze: 6.0.500 / Virov? b?ze: 298 - datum vyd?n?: 10.7.2003
Gabriele G. Ponti - 14 Jul 2003 13:52 GMT
Martin,

I don't know the details of your application, but when you add a MenuItem to
your menu you can specify the event handler:

   mnu.MenuItems.Add("Item 1", New EventHandler(AddressOf mnu_Click))

If this doesn't work for you because you can get the address of the
procedure, you can use a common procedure for all the MenuItems events, then
using the Index property of the sender object you can at least find out what
was selected and take the appropriate actions.

For example:

   ' add items
   mnu.MenuItems.Add("Item 1", New EventHandler(AddressOf mnu_Click))
   mnu.MenuItems.Add("Item 2", New EventHandler(AddressOf mnu_Click))
   mnu.MenuItems.Add("Item 3", New EventHandler(AddressOf mnu_Click))

   Protected Sub mnu_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

       Dim i As Integer

       ' get index
       i = sender.Index

       ' do something with i
       ' ...

   End Sub

HTH,

   Gabriele

> Hi all,
>
[quoted text clipped - 9 lines]
> Zkontrolov?no antivirov?m syst?mem AVG (http://www.grisoft.cz).
> Verze: 6.0.500 / Virov? b?ze: 298 - datum vyd?n?: 10.7.2003

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.