Salat Posted July 16, 2003 Posted July 16, 2003 I'm useing some code, to show few files at a specified path with a menuitems. So this code has a for each filename in dirname loop and it's useing MenuItem5.MenuItems.Add(filename) to list those files. and the problem is with handling the event of click at the menuitem of a specified filename. There is no event of Menuitem5, which will corespond with MenuItem5's child clicked. How can I solve this problem, Have You got any ideas? thank You any sugestions. Piotrek Quote profesjonalne programowanie na zlecenie :)
Leaders dynamic_sysop Posted July 16, 2003 Leaders Posted July 16, 2003 here's how i'd handle the event , you can add more handlers as you go along : Dim obj As MenuItem Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click obj = MenuItem1.MenuItems.Add("some text") AddHandler obj.Click, AddressOf item1_Click End Sub Public Sub item1_Click(ByVal sender As Object, ByVal e As System.EventArgs) MsgBox(sender.text) End Sub hope it helps. Quote
Salat Posted July 18, 2003 Author Posted July 18, 2003 thank You... it's working well Quote profesjonalne programowanie na zlecenie :)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.