DIAdem Help

Object: ActionObjButton

  • Updated2024-09-12
  • 1 minute(s) read

Object: ActionObjButton

The ActionObjButton object provides a bar element that corresponds to a button.

The element is a button if the Type property of the bar element contains the value eActObjTypeButton.

The following example adds a button to the toolbar in DIAdem ANALYSIS. The example assigns a graphic and a tooltip to the button.

VBScriptPython

 

Dim oMyActionObj
If not (BarManager.ActionObjs.Exists("MyButton")) Then
  Set oMyActionObj = BarManager.ActionObjs.Add("MyButton", "CustomButton") 
  oMyActionObj.Picture = "favicon.ico"
  oMyActionObj.Tooltip = "MyButton"
  oMyActionObj.OnClickCode.Code = "Call MsgBoxDisp(""MyButton"")"
Else
  Set oMyActionObj = BarManager.ActionObjs("MyButton")
End If
Call BarManager.Bars("ANAMain").UsedActionObjs.Add(oMyActionObj)