The StandardFrame object implements the functionality needed to define Windows-like frames. Standard frames consist of four elements: outer bevel, bevel distance, inner bevel and border line. Bevels define edges and can be either disabled, raised or sunken. The bevels styles are controlled via the InnerStyle and OuterStyle properties of the StandardFrame object. The following image illustrates a frame with a raised outer bevel and a sunken inner bevel. The bevel distance is painted in blue and the border in red.
VB.NET | |
---|---|
|
C# | |
---|---|
|
The inner bevel is rendered using the InnerLight and InnerDark colors of the StandardFrame object. Initially these colors are set to KnownColor.Control and KnownColor.ControlDarkDark, respectively.
The outer bevel on the other hand is rendered using the OuterLight and OuterDark colors of the StandardFrame object. Initially these colors are set to KnownColor.ControlLightLight and KnownColor.ControlDark, respectively.
You can also control the width of the bevels by using the BevelWidth property. Please note that this property controls the width of both the inner and the outer bevel and is specified in pixels. The distance between the bevels is controlled by the BevelDistance, also specified in pixels. The color of the bevel distance is controlled by the BevelDistanceColor property.
The Border property exposes a LineProperties object that controls the appearance of the inner border line.
Related Examples
Windows Forms: Background frame\General