I want to change the picture of a buttondefinition.
How can I do that?
Geert
Code:
'Make Button
Dim objControlDefs As ControlDefinitions
Set objControlDefs = objInventorApp.CommandManager.ControlDefinitions
Dim objUpdateModelCmdPicture As IPictureDisp
Set objUpdateModelCmdPicture = LoadResPicture(126, vbResIcon)
Set mobjUpdateModelCmd = objControlDefs.AddButtonDefinition("Update Model", "UpdateModelCmd", kQueryOnlyCmdType, strClientID, , , objUpdateModelCmdPicture, objUpdateModelCmdPicture)
'Change picture of button
Dim objUpdateModelCmdPicture As IPictureDisp
Set objUpdateModelCmdPicture = LoadResPicture(127, vbResIcon)
Dim objCommandBars As CommandBars
Set objCommandBars = objUserInterfaceMgr.CommandBars
'select commandbar where button resides
Dim objDataLINKCmdBar As CommandBar
Set objDataLINKCmdBar = objCommandBars.Add("DataLINK", "DataLINKCmdBar", kRegularCommandBar, strClientID)
'?????? How to change the picture of commandbutton
objDataLINKCmdBar.Controls.Item ("UpdateModelCmd")