Class BaseControl
Represents a BaseControl with IThemeProvider VisualStyle based theme customization settings.
Inheritance
Namespace: Syncfusion.Windows.Forms.Core
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class BaseControl : Control, IThemeProvider, IVisualStyle, IDisposable
Constructors
BaseControl()
Declaration
public BaseControl()
Properties
CanApplyTheme
Gets or sets a value indicating whether a SkinManager theme settings can be applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
Remarks
This property must be initialized before applying the VisualTheme />
CanOverrideStyle
Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.
Declaration
public bool CanOverrideStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
Remarks
By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.
ControlName
Gets the name of the control.
Declaration
public string ControlName { get; }
Property Value
Type |
---|
System.String |
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the control and also indicates whether the theme files are referred from external assemblies or not.
Declaration
public bool IsVisualStyleEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Return true, if the visual style based theme is applied to the control. Otherwise returns false. |
ThemeName
Gets or sets the theme name of the control.
Declaration
public string ThemeName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null. |
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
Methods
GetActiveThemeName()
Gets the active theme name of the control.
Declaration
public virtual string GetActiveThemeName()
Returns
Type | Description |
---|---|
System.String | Returns the active theme name. |
GetControlName(String)
Helps to override the ThemeName property settings
Declaration
public virtual string GetControlName(string controlName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controlName | ThemeName |
Returns
Type |
---|
System.String |
OnCanApplyThemeChanged(Boolean)
Helps to override the CanApplyTheme property settings
Declaration
public virtual void OnCanApplyThemeChanged(bool canApplyTheme)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canApplyTheme |
OnCanOverrideStyleChanged(Boolean)
Helps to override the CanOverriderStyle property settings
Declaration
public virtual void OnCanOverrideStyleChanged(bool canOverrideStyle)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | canOverrideStyle |
OnThemeNameChanged(String)
Helps to override the ThemeName property settings
Declaration
public virtual void OnThemeNameChanged(string themeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeName | ThemeName |
RaiseThemeChanged(Object, ThemeChangedEventArgs)
Raises the ThemeNameChanged event when theme name changed.
Declaration
protected virtual void RaiseThemeChanged(object sender, ThemeChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender value. |
ThemeChangedEventArgs | args | A ThemeChangedEventArgs contains the event data. |
Events
ThemeNameChanged
Occurs when theme name of the control has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
Type |
---|
ThemeChangedEventHandler |
Explicit Interface Implementations
IVisualStyle.VisualTheme
Gets or sets the VisualTheme of the control.
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |
IThemeProvider.BaseThemeName
Gets or sets the Base Theme name of the theme
Declaration
string IThemeProvider.BaseThemeName { get; set; }
Returns
Type |
---|
System.String |