Results 1 to 13 of 13

Thread: [RESOLVED] Adding context menu items

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    774

    Resolved [RESOLVED] Adding context menu items

    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?
    Last edited by paulg4ije; Jan 20th, 2013 at 07:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width