Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

VS 2010 Adding context menu items

$
0
0
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:
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

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?

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>