Creating a Menu Command with Visual Basic .Net

Dear Sir,

     i'd tried below menu command coding but not show toolbarImage

Public Sub GetAddInInfo(ByRef poInfo As EdmLib.EdmAddInInfo, ByVal poVault As EdmLib.IEdmVault5, ByVal poCmdMgr As   EdmLib.IEdmCmdMgr5) Implements EdmLib.IEdmAddIn5.GetAddInInfo

poInfo.mbsAddInName = "Menu command sample"
poInfo.mbsCompany = "SolidWorks Corporation"
poInfo.mbsDescription = "Adds menu items and toolbar buttons"
poInfo.mlAddInVersion = 1
poInfo.mlRequiredVersionMajor = 12
poInfo.mlRequiredVersionMinor = 2

iNormalBmp = My.Resources.Resource1.ToolbarNormal.GetHbitmap.ToInt32
iHotBmp = My.Resources.Resource1.ToolbarHot.GetHbitmap.ToInt32
 
poCmdMgr.AddToolbarImage(iHotBmp, 2, EdmButtonState.BState_Hot, False, True, &HC0C0C0, 99)

poCmdMgr.AddCmd(1000, "First command", EdmMenuFlags.EdmMenu_HasToolbarButton, "This is the first command", "First command", 0, 99)

poCmdMgr.AddCmd(1001, "Second command", EdmMenuFlags.EdmMenu_HasToolbarButton Or EdmMenuFlags.EdmMenu_MustHaveSelection, "This is the second command", "Second command", 1, 99)

End Sub

Public Sub OnCmd(ByRef poCmd As EdmLib.EdmCmd, ByRef ppoData As System.Array) Implements EdmLib.IEdmAddIn5.OnCmd

         Dim frm As New Form1

          frm.Show()

End Sub


SolidworksSolidworks Pdm enterprise Pdm
Answers 3
SF
SF 2012-10-09 Best Answer

Hi Arun

What behavior are you trying to accomplish with this addin?

If you can expand, we may be able to assist.

Best regards,

Tim

AS
AS 2012-10-11

Dear Sir,

          I'd click the toolbar image, load one new form and some function handle this,

Click Image --> show New form

LY
LY 2012-10-11

See SPR-598962; looks like a bug.