I have a context menu (mnuContext) created at design-time and I want to modify one entry at runtime. I can't see an obvious way to modify an entry so deleting and adding will be fine. I must be doing something daft as I can't get this to work:
The error is 'ContextImageProperties' is not declared' on the AddHandler line, which seems odd as it's defined as a ToolStripMenuItem. What am I doing wrong?
Code:
Dim ContextImageProperites As New ToolStripMenuItem
ContextImageProperites.Text = "Image Properties..."
ContextImageProperites.Tag = "10"
AddHandler ContextImageProperties.Click, AddressOf ContextImageProperties_Click
mnuContext.Items.Add(ContextImageProperites)
...
Private Sub ContextImageProperties_Click(sender As System.Object, e As System.EventArgs)
MsgBox("Clicked Image Properties!")
End Sub