Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Why is it that when I do this:

 

With mnuFile
   .menuitems.add("&New", new eventhandler(addressof mnuNew_Click))
End With

 

it works, but when I use the constructor with a shortcut:

 

with mnuFile
   .menutems.add("&New", new eventhandler(addressof mnuNew_Click), Shortcut.CtrlN)
End With

 

I get the error "BC30516: Overload resolution failed because no accessible 'Add' accepts this number of arguments."

  • *Experts*
Posted
That's not the constructor, that's the Add() method of the MenuItemCollection. Try using this instead:
With mnuFile
   .menutems.add(New MenuItem("&New", New eventhandler(AddressOf mnuNew_Click), Shortcut.CtrlN))
End With

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...