Although the native button form PI ProcessBook is a symbol with the property BackgroundColor, it is not possible to change this property. The following code snippet lets you check if this feature it present programmatically:
Const PBOA_USE_FILL_COLOR = 14 Const PBOA_USE_BACKGROUND_COLOR = 15 Public Sub CheckButtonCapabilities() Dim bHasCapability As Boolean bHasCapability = Button1.GetCapability(PBOA_USE_BACKGROUND_COLOR) If bHasCapability = False Then MsgBox "This object can not use a Backgroundcolor" ElseIf bHasCapability = True Then MsgBox "This object can use a Backgroundcolor" End If
You could use the "Microsoft Forms 2.0 CommandButton" which lets you choose the background color among some options provided. Nevertheless, I didn't see an option for the red or green color.
On Microsoft Visual Basic, there are two comboboxes. On the left, you can see all the variables representing objects on the display. On the right, you can see its events. I was not able to "Enable Scripting" for the rectangle so you should try using a button instead with the options of events available for you to achieve your goal.
Hope it helps!
Hello Thomas & Marcos,
I was able to enable scripting for a rectangle symbol. Several events e.g. a MouseOver are available for me.
I have created a new display and now I was also able to enable the rectangle. I can also see "MouseOver"and "MouseOut" events. Not sure what has happened.
Rectangle can use MouseOver and MouseOut event, I used rectangle to replaced button.