
Use VBA function "RGB" to assign a color to a property. The color "red", for example, is
represented as follows: RGB(255, 0, 0)
Example:
The "RectangleConfiguration()" procedure accesses the properties of the rectangle. In this
example the background color will be set to "Yellow".
Sub RectangleConfiguration()
'VBA493
Dim objRectangle As HMIRectangle
Set objRectangle = ActiveDocument.HMIObjects.AddHMIObject("Rectangle1", "HMIRectangle")
With objRectangle
.FillColor = RGB(255, 255, 0)
End With
End Sub
See also
Button Object (Page 1824)
StaticText Object (Page 1956)
Slider object (Page 1952)
TextList Object (Page 1964)
RoundRectangle Object (Page 1945)
RoundButton Object (Page 1942)
Rectangle Object (Page 1939)
Polygon Object (Page 1925)
PieSegment Object (Page 1922)
OptionGroup Object (Page 1916)
GroupDisplay Object (Page 1874)
GraphicObject Object (Page 1870)
IOField Object (Page 1886)
EllipseSegment Object (Page 1859)
Ellipse Object (Page 1853)
Document Object (Page 1847)
Circle Object (Page 1828)
CheckBox Object (Page 1827)
BarGraph Object (Page 1819)
3DBarGraph Object (Page 1805)
VBA for Automated Configuration
4.4 The object model of the Graphics Designer
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
2105