By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,672 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,672 IT Pros & Developers. It's quick & easy.

Events in dynamic loaded assembly

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Martin Falta" <ma**********@atlas.cz> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
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

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.