Color.FrameColor

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Shared Method

Color.FrameColor() As Color

New in 2019r2

Supported for all project types and targets.

The color used for drawing the outline of a DesktopUIControl.

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 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)

See Also

Color for a complete list of functions; Color data type; Dark Mode topic.