Results 1 to 5 of 5

Thread: Popup Menu on Usercontrol Pls help !!!

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Sydney
    Posts
    4

    Question Popup Menu on Usercontrol Pls help !!!

    Hi everyone

    How do I create a popup menu on usercontrol.
    In Usercontrol VB allows me to use Menu Editor to add a menu to Usercontrol. But when I call the menu as something like usually in the Form,

    Me.PopupMenu mnuMyFile

    I can't use Me. here can I ?

    Example would be great

    Cheers

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    PopupMenu mnuMyFile

    or

    UserControl.PopupMenu mnuMyFile

    ?
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    in a usercontrol sample

    VB Code:
    1. Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     If Button = vbRightButton Then PopupMenu popMenutest
    3. End Sub
    -= a peet post =-

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Sydney
    Posts
    4
    Thanks alot

    It works man, but why I can't use Me.something ... instead of just write popupmenu. Anyway, that's not important.

    Cheers

  5. #5
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by urbanpir8
    Thanks alot

    It works man, but why I can't use Me.something ... instead of just write popupmenu. Anyway, that's not important.

    Cheers
    You can't use Me because that is a keyword that refers to the current form. Since the user control is placed on the form, it cannot use the Me keyword for itself, or things would get all screwy. Just replace Me with UserControl or just go without. Either way works.
    <removed by admin>

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