Color.FrameColor
From Xojo Documentation
Method
The system control color.
Usage
result = Color.FrameColor
Part | Type | Description |
---|---|---|
result | Color | The color used for drawing the outline of a RectControl. |
Notes
This value is useful when you are using Canvas controls to create custom controls. When drawing objects, use this color for the object’s frame. ListBoxes, for example, use this color to draw the dark frame around the ListBox.
This value can be changed by the user or when the system switches between light and dark modes, so you should use this method in your Paint Event handler rather than storing the value.
Sample Code
This code uses the system FrameColor to draw the bottom and right of this object. The code is in the Paint event of the Canvas.
Const White = &cffffff
g.DrawingColor = White
g.DrawLine(1, 1, g.Width, 1)
g.DrawLine(1, g.Height - 1, 1, 1)
g.DrawingColor = Color.FrameColor
g.DrawLine(g.Width - 1, 2, g.Width - 1, g.Height)
g.DrawLine(1, g.Height - 1, g.Width, g.Height - 1)
// Fill in using the system Fill color
g.DrawingColor = Color.FillColor
g.FillRectangle(2, 2, g.Width - 3, g.Height - 3)
g.DrawingColor = White
g.DrawLine(1, 1, g.Width, 1)
g.DrawLine(1, g.Height - 1, 1, 1)
g.DrawingColor = Color.FrameColor
g.DrawLine(g.Width - 1, 2, g.Width - 1, g.Height)
g.DrawLine(1, g.Height - 1, g.Width, g.Height - 1)
// Fill in using the system Fill color
g.DrawingColor = Color.FillColor
g.FillRectangle(2, 2, g.Width - 3, g.Height - 3)
See Also
Color for a complete list of functions; Color data type; Dark Mode topic.