Border and Button Styles
- 2 minutes to read
Each control provided by the XtraEditors library supports the Look And Feel mechanism which allows you to customize the overall look and feel of the control. The look and feel settings determine the painting scheme applied to the control. By default the look and feel specifies how borders, buttons and dropdowns are painted. This topic shows how to override the default painting styles for these elements.
Using Border and Button Styles
Controls that aren’t available as inplace editors provide a BaseControl.BorderStyle property which specifies the paint style of the border.
Editors derived from the BaseEdit class (which can be used inplace, e.g. within the XtraGrid) provide the following style properties:
- RepositoryItem.BorderStyle. This property specifies how the control’s borders are painted and is available for all editors.
- RepositoryItemButtonEdit.ButtonsStyle. This property specifies how editor buttons are painted and is available for ButtonEdit controls and their descendants.
- RepositoryItemPopupBase.PopupBorderStyle. This property specifies how the popup window’s borders are painted and is available for all editors with popup windows (PopupBaseEdit descendants).
Initially, these properties are set to the Default values. In this case an editor’s corresponding element is painted using the LookAndFeel settings. If a property is set to any other value the editor’s element will be painted using the corresponding scheme and the look and feel settings for this element will be ignored.
The available border and button styles (values that can be assigned to the style properties above) are listed below:
Flat - borders and buttons are flat.
HotFlat - borders are flat and represented by a single light gray line. Buttons are also flat and highlighted when hot-tracked.
NoBorder - no borders are shown. Buttons are flat.
Simple - borders are flat and represented by a single dark gray line. Buttons are flat and have a single dark gray line border.
Style3D - borders and buttons are painted in the 3D style.
UltraFlat - the Office XP style emulation. Borders and buttons are highlighted when hot-tracked or focused. Otherwise, no borders are displayed.