Class ButtonAdv
Button with advanced rendering features
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class ButtonAdv : Button, ISupportOffice2007Theme, ISupportThemeChanged, IMessageFilter, IThemeProvider, IVisualStyle
Constructors
ButtonAdv()
Declaration
public ButtonAdv()
ButtonAdv(Boolean)
Constructor.
Declaration
public ButtonAdv(bool isComboButton)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isComboButton | Indicates whether button is of combo button type. |
Fields
isFirstRightButton
Indicates whether renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
public bool isFirstRightButton
Field Value
| Type |
|---|
| System.Boolean |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
isLastLeftButton
Indicates whether renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
public bool isLastLeftButton
Field Value
| Type |
|---|
| System.Boolean |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
Properties
Appearance
Gets or sets the look and feel of the ButtonAdv. Set UseVisualStyle
to True if you want to apply style on button, otherwise False.
Declaration
public ButtonAppearance Appearance { get; set; }
Property Value
| Type |
|---|
| ButtonAppearance |
BackColor
Gets or sets the background color of the ButtonAdv
Declaration
public override Color BackColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
BeforeTouchSize
Gets/Sets Control size before touch enabled
Declaration
public Size BeforeTouchSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
BorderStyleAdv
Gets or sets ButtonAdv border style. Borders styles supported only in appearance styles: Office2003, OfficeXP and WindowsXP.
Declaration
public ButtonAdvBorderStyle BorderStyleAdv { get; set; }
Property Value
| Type |
|---|
| ButtonAdvBorderStyle |
ButtonType
Gets or sets the type of button to be used.
Declaration
public virtual ButtonTypes ButtonType { get; set; }
Property Value
| Type |
|---|
| ButtonTypes |
CanApplyTheme
Gets or sets a value indicating whether a SkinManager theme style has been applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is true. |
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.
ComboEditBackColor
Gets or sets the combo edit backcolor.
Declaration
public Color ComboEditBackColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
CustomManagedColor
Gets or sets the background color of the ButtonAdv
Declaration
public Color CustomManagedColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
EnableTouchMode
gets or sets the touchmode
Declaration
public virtual bool EnableTouchMode { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Font
Gets or sets the System.Drawing.Font value for the control.
Declaration
public override Font Font { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Font |
ForeColor
Gets or sets the foreground color of the ButtonAdv
Declaration
public override Color ForeColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
ImageListAdv
Declaration
public ImageListAdv ImageListAdv { get; set; }
Property Value
| Type |
|---|
| ImageListAdv |
IsBackStageButton
Gets/Sets the value for IsBackStageButton
Declaration
public bool IsBackStageButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsComboButton
Indicates whether the button is of ComboButton type.
Declaration
public bool IsComboButton { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsDropDownButton
Gets/Sets whether this is DropDownButton
Declaration
public bool IsDropDownButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsMouseDown
Indicates whether the mouse is currently pressed.
Declaration
public bool IsMouseDown { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
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. |
KeepFocusRectangle
Gets or Sets value specifying whether ButtonAdv will show focus rectangle receiveng focus.
Declaration
public bool KeepFocusRectangle { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
MetroColor
Gets or sets the MetroColor color of the ButtonAdv
Declaration
public Color MetroColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
Office2007ColorScheme
Gets or sets office 2007 color scheme.
Declaration
public Office2007Theme Office2007ColorScheme { get; set; }
Property Value
| Type |
|---|
| Office2007Theme |
Office2010ColorScheme
Gets or sets office 2010 color scheme.
Declaration
public Office2010Theme Office2010ColorScheme { get; set; }
Property Value
| Type |
|---|
| Office2010Theme |
OverrideFormManagedColor
Gets or sets a value indicating whether the custom managed color is to be applied by overriding the Form's managed color
Declaration
public bool OverrideFormManagedColor { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
PushButton
Indicates the state of control.
Declaration
public bool PushButton { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ResetStateOnLostFocus
Gets or sets a value indicating whether state should be reset on focus lost.
Declaration
public bool ResetStateOnLostFocus { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
State
Gets or sets the different states the button can hold: Default, MouseOver, Pressed.
Declaration
public ButtonAdvState State { get; set; }
Property Value
| Type |
|---|
| ButtonAdvState |
Text
Gets or sets the text to be displayed on the button.
Declaration
public override string Text { get; set; }
Property Value
| Type |
|---|
| System.String |
ThemeName
Gets or sets the theme name of the ButtonAdv control.
Declaration
public string ThemeName { get; set; }
Property Value
| Type |
|---|
| System.String |
ThemeStyle
Declaration
public ButtonAdvVisualStyle ThemeStyle { get; set; }
Property Value
| Type |
|---|
| ButtonAdvVisualStyle |
UseVisualStyle
Indicates whether Visual Styles must be enabled for the button.
Set value to True if you want to apply settings of properties:
Appearance, BorderStyleAdv, ButtonType
and etc. on current button.
Declaration
public virtual bool UseVisualStyle { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
ApplyScaleToControl(Single)
applies the scaling
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | scaleFactor |
Dispose(Boolean)
Cleans up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
GetActiveThemeName()
Gets the active theme name of the ButtonAdv control.
Declaration
public string GetActiveThemeName()
Returns
| Type | Description |
|---|---|
| System.String | Returns the active theme name. |
GetControlName()
Returns the name of the control.
Declaration
protected virtual string GetControlName()
Returns
| Type |
|---|
| System.String |
GetIsFirstRightButton()
If the IsFirstRightButton is set to True, the button's renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
protected bool GetIsFirstRightButton()
Returns
| Type |
|---|
| System.Boolean |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
GetIsLastLeftButton()
If the isLastleftButton is set to True, the button's renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
protected bool GetIsLastLeftButton()
Returns
| Type |
|---|
| System.Boolean |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
OnButtonChanged(EventArgs)
Declaration
protected virtual void OnButtonChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnClick(EventArgs)
Declaration
protected override void OnClick(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnFontChanged(EventArgs)
Font changed event
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnHandleCreated(EventArgs)
Raises the System.Windows.Forms.Control.HandleCreated event.
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | An System.EventArgs that contains the event data. |
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnKeyDown(KeyEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs) event.
Declaration
protected override void OnKeyDown(KeyEventArgs kevent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.KeyEventArgs | kevent | A System.Windows.Forms.KeyEventArgs that contains the event data. |
OnKeyUp(KeyEventArgs)
Raises the System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs) event.
Declaration
protected override void OnKeyUp(KeyEventArgs kevent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.KeyEventArgs | kevent | A System.Windows.Forms.KeyEventArgs that contains the event data. |
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.MouseEventArgs | e |
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | e |
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
OnSystemColorsChanged(EventArgs)
Declaration
protected override void OnSystemColorsChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e |
PaintButton(Graphics, ButtonAdv, Point)
Drawing ButtonAdv's surface on custom Graphics
Declaration
public static void PaintButton(Graphics g, ButtonAdv control, Point p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics to draw on |
| ButtonAdv | control | buttonAdv control to draw |
| System.Drawing.Point | p | Point that represents the location of the upper-left corner of the drawn image. |
Examples
private void pictureBox1_Paint(object sender, PaintEventArgs e) { e.Graphics.RotateTransform(20); ButtonAdv.PaintButton(e.Graphics, this.buttonAdv1, new Point(75, 25)); }
RaisePaintEvent(PaintEventArgs)
Method allow to raise System.Windows.Forms.Control.Paint event.
Declaration
protected void RaisePaintEvent(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.PaintEventArgs | e | Paint event arguments. |
ResetBackColor()
Resets the System.Windows.Forms.Control.BackColor property to its default value.
Declaration
public override void ResetBackColor()
ResetComboEditBackColor()
Resets the ComboEditBackColor to default.
Declaration
protected virtual void ResetComboEditBackColor()
ResetForeColor()
Resets the System.Windows.Forms.Control.ForeColor property to its default value.
Declaration
public override void ResetForeColor()
ResetIsDropDownButton()
Reset DropDown Button
Declaration
public void ResetIsDropDownButton()
ResetMetroColor()
To Reset MetroColor
Declaration
public void ResetMetroColor()
ResetUseVisualStyle()
Resets the UseVisualStyle to default.
Declaration
protected virtual void ResetUseVisualStyle()
ResumeMouseState()
Recover mouse handling logic for property State. To suspend call SuspendMouseState() method.
Declaration
public void ResumeMouseState()
SetIgnoreMouse(Boolean)
Recover or suspends mouse handling logic for property State.
Declaration
[Obsolete("Do not use this method. Instead use methods pair SuspendMouseState, ResumeMouseState.")]
public void SetIgnoreMouse(bool ignoreMouse)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | ignoreMouse | True to suspend, otherwise to resume handling logic. |
SetIsFirstRightButton(Boolean)
If the IsFirstRightButton is set to True, the button's renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
public void SetIsFirstRightButton(bool val)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | val | The value that is to be set. |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
SetIsLastLeftButton(Boolean)
If the isLastleftButton is set to True, the button's renderer could draw the background for half of the control differently. Used in XP style when used as a combo button.
Declaration
public void SetIsLastLeftButton(bool val)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | val | The value that is to be set. |
Remarks
Used only for by Syncfusion.Windows.Forms.WindowsXPButtonRenderer class.
ShouldSerializaIsDropDownButton()
Specifies whether this is DropDown Button
Declaration
[Obsolete("ShouldSerializaIsDropDownButton is deprecated, please use ShouldSerializeIsDropDownButton instead.")]
public bool ShouldSerializaIsDropDownButton()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeBackColor()
Indicates whether the BackColor property should be persisted.
Declaration
public virtual bool ShouldSerializeBackColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeComboEditBackColor()
Declaration
protected virtual bool ShouldSerializeComboEditBackColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeForeColor()
Declaration
protected virtual bool ShouldSerializeForeColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeIsDropDownButton()
Specifies whether this is DropDown Button
Declaration
public bool ShouldSerializeIsDropDownButton()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeMetroColor()
To indicate whether to serialize MetroColor or not
Declaration
public bool ShouldSerializeMetroColor()
Returns
| Type |
|---|
| System.Boolean |
ShouldSerializeUseVisualStyle()
Declaration
protected virtual bool ShouldSerializeUseVisualStyle()
Returns
| Type |
|---|
| System.Boolean |
SuspendMouseState()
Suspend State property updating till the ResumeMouseState() method call.
Declaration
public void SuspendMouseState()
Events
ButtonChanged
Indicates whether Appearance of the ButtonAdv has changed.
Declaration
public event EventHandler ButtonChanged
Event Type
| Type |
|---|
| System.EventHandler |
ThemeNameChanged
Occurs when theme name of the ButtonAdv has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
| Type |
|---|
| ThemeChangedEventHandler |
Explicit Interface Implementations
ISupportOffice2007Theme.EnableOffice2007Style()
Declaration
void ISupportOffice2007Theme.EnableOffice2007Style()
ISupportOffice2007Theme.Office2007ColorTheme
Declaration
Office2007Theme ISupportOffice2007Theme.Office2007ColorTheme { get; set; }
Returns
| Type |
|---|
| Office2007Theme |
ISupportThemeChanged.ThemeChanged(Object, EventArgs)
Declaration
void ISupportThemeChanged.ThemeChanged(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | |
| System.EventArgs | e |
IVisualStyle.VisualTheme
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
| Type |
|---|
| System.String |
IThemeProvider.BaseThemeName
Gets or sets the BaseTheme name of the theme
Declaration
string IThemeProvider.BaseThemeName { get; set; }
Returns
| Type |
|---|
| System.String |
IThemeProvider.ControlName
Gets the name of the control.
Declaration
string IThemeProvider.ControlName { get; }
Returns
| Type |
|---|
| System.String |