CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    8

    Assign code to a menuitem

    Hey.

    Im going to make my app visible in the system tray and i followed the example in MSDN but cant get the menuitems to work.
    I have added one item on the main level called SysTray with the name 'mPopupSys' then i have two items on that one called 'mPopRestore' and 'mPopExit'.

    Then when im going to declare them and add code to them i get following error msg:
    'Procedure declaration does not match description of event or procedure having the same name'

    This is how i declared them in my form:
    private Sub mPopExit_Click()
    Unload me
    End Sub



    I tried to make them public or just sub's but it doesnt work.. it seems like they are in somekind of conflict with the menuitems.. dunno..
    Im sure that i havent delcared the procedure twice, ive checked that =)

    Please help.

    C B

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Assign code to a menuitem

    did you specify an Index property in the menu editor for your menu items?
    If so, the declaration should look like this:

    private Sub mPopExot_Click(Index as Integer)

    End Sub





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

Featured