为应用程序中所有控件提供共同的外观与感觉设置的最好方法,是使用 Default LookAndFeel(默认的外观与感觉)。 缺省时,所有控件都使用 Default LookAndFeel 设置。 控件仅在下列情况下不使用 Default LookAndFeel:

在所有其他情况下,控件的绘制方案都由 Default LookAndFeel 确定。 Default LookAndFeel 设置可以通过 DefaultLookAndFeel 组件或通过静态的 UserLookAndFeel.Default 属性进行访问。

下列代码对 Default LookAndFeel 进行了定制,并且确保一个 XtraTabControl 使用由 Default LookAndFeel 公开的绘制设置。

C#CopyCode image复制代码
using DevExpress.LookAndFeel;

// Access the Default LookAndFeel.
UserLookAndFeel defaultLF = UserLookAndFeel.Default;
// Ensure that the Office2003 painting scheme will be used.
defaultLF.UseWindowsXPTheme = false;
defaultLF.Style = LookAndFeelStyle.Office2003;
// Ensure that the Default LookAndFeel will be applied.
xtraTabControl1.LookAndFeel.UseDefaultLookAndFeel = true;
// Remove the Parent LookAndFeel (if any).
xtraTabControl1.LookAndFeel.ParentLookAndFeel = null;

Visual BasicCopyCode image复制代码
Imports DevExpress.LookAndFeel

' Access the Default LookAndFeel.
Dim defaultLF as UserLookAndFeel = UserLookAndFeel.Default
' Ensure that the Office2003 painting scheme will be used.
defaultLF.UseWindowsXPTheme = False
defaultLF.Style = LookAndFeelStyle.Office2003
' Ensure that the Default LookAndFeel will be applied.
XtraTabControl1.LookAndFeel.UseDefaultLookAndFeel = True
' Remove the Parent LookAndFeel (if any).
XtraTabControl1.LookAndFeel.ParentLookAndFeel = Nothing

如果显示如下: