I'm trying to dynamically add a menuitem to my context menu and add a click handler but for some reason it won't add the handler what did a do wrong?
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click For Each Line In RichTextBox1.Lines Dim NewItem As New MenuItem NewItem.Text = Line AddHandler NewItem.Click, AddressOf NewItem_Click ContextMenuStrip1.Items.Add(Line) Next End Sub Private Sub NewItem_Click(sender As Object, e As EventArgs) MsgBox(CType(sender, MenuItem).Text) End Sub
Dim NewItem As ToolStripMenuItem = New ToolStripMenuItem NewItem.Text = Line AddHandler NewItem.Click, AddressOf NewItem_Click ContextMenuStrip1.Items.Add(NewItem)
Edited by tinstaafl
maybe try firts to debug your codes to see what is the problem.
hi i used this simple form which are these..but i want to protect password from oracle database if user enter wrong name and password then not login otherwise login
Hi. I have a .raw file and I want to display it as hex. why? because i want to try and replicate what 010 Editor can do which is read ...
I was wondering what would be the best way to implement an algorythm to figure out what side a circle has collided with a rectangle?
After check to make sure ...