Registers an image with a toolbar button.
NOTE: This method does not work in Windows Vista and later Windows operating systems.
Syntax
Parameters
- lHandleOrResourceID
- Resource ID if bIsHandle = false; handle to a bitmap (bIsIcon = false) or icon (bIsIcon = true) if bIsHandle = true
- lButtonCount
- Number of buttons in the bitmap or icon
- eState
- State of the toolbar button (see Remarks)
- bIsIcon
- True if the image is an icon; false if it is a bitmap (see Remarks)
- bIsHandle
- True if lHandleOrResourceID is a handle, false if it is a resource ID
- lBackgroundColorRGB
- RGB value of the background color (see Remarks)
- lImageID
- ID of the image (see Remarks)
Example
For a more complete description of how to use this method, see Creating a menu command.
The following snippet creates a toolbar button and adds a command in the Windows Explorer Tools menu. The button uses one icon (resource ID=101) for the cold (standard) state and another one (resource ID=102) for the hot (focus) state. Both icon files must be added using Visual Basic's resource editor before running this snippet:
Private Sub IEdmAddIn5_GetAddInInfo(poInfo As EdmLib.EdmAddInInfo, ByVal poVault As EdmLib.IEdmVault5, ByVal poCmdMgr As EdmLib.IEdmCmdMgr5)
...
poCmdMgr.AddToolbarImage 101, 1, BState_Cold, True, False, 12632256, 1
poCmdMgr.AddToolbarImage 102, 1, BState_Hot, True, False, 12632256, 1
poCmdMgr.AddCmd 1, "My Command", EdmMenu_NeverInContextMenu Or EdmMenu_HasToolbarButton, "String to show in the statusbar", "Tooltip on my command", 0, 1
End Sub
Remarks
See Also
Availability
SOLIDWORKS PDM Professional Version 5.2