Class NumericUpDownExt
Extends the NumericUpDown to provide XP Look and Feel.
Implements
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class NumericUpDownExt : NumericUpDown, IThemeProvider, IThemedControl, INonClientPaintingSupport, ISupportOffice2007Theme, IVisualStyle
Remarks
Take a look at the ThemesEnabled and ThemedBorder properties.
Constructors
NumericUpDownExt()
Initializes a new instance of the NumericUpDownExt class.
Declaration
public NumericUpDownExt()
Properties
BackColor
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 |
Border3DStyle
Gets or sets the style of the 3D border.
Declaration
public Border3DStyle Border3DStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Border3DStyle |
Remarks
This style is used when the BorderStyle is Fixed3D and when XP Themed drawing is disabled.
BorderColor
Gets or sets the color of the 2D border.
Declaration
public Color BorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BorderSides
Gets or sets the border sides of the control that will be drawn in 3D mode.
Declaration
public Border3DSide BorderSides { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Border3DSide |
BorderStyle
Gets or sets the border style for the control.
Declaration
public BorderStyle BorderStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.BorderStyle |
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.
ColorScheme
Gets or sets Office2007Theme for Office2007 style.
Declaration
public Office2007Theme ColorScheme { get; set; }
Property Value
Type |
---|
Office2007Theme |
ControlName
Gets the name of the control.
Declaration
public string ControlName { get; }
Property Value
Type |
---|
System.String |
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Type |
---|
System.Windows.Forms.CreateParams |
EnableTouchMode
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Scale factor will be updated automatically if scalefactor is equal to 1
Font
Overrides the base class font property.
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
HexValue
Gets the value in hexadecimal numeration.
Declaration
public string HexValue { get; }
Property Value
Type |
---|
System.String |
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the control. This 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 control. Otherwise returns false. |
MaxLength
Gets or sets the maximum length of the text that can be entered into the editable portion of the control.
Declaration
public int MaxLength { get; set; }
Property Value
Type |
---|
System.Int32 |
MetroColor
Gets or Sets the MetroColor
Declaration
public Color MetroColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Office2010ColorScheme
Gets or sets Office2010Theme for Office2010 style.
Declaration
public Office2010Theme Office2010ColorScheme { get; set; }
Property Value
Type |
---|
Office2010Theme |
ReadOnly
Gets or sets a value indicating whether the text can be changed by the use of the up or down buttons only.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
ThemedBorder
Gets or sets a value indicating whether you want themed border around the control when themes are enabled.
Declaration
public bool ThemedBorder { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This property is used only when the ThemesEnabled property is set.
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.
ThemesEnabled
Gets or sets a value indicating whether XP Themes (visual styles) should be used for this control when available.
Declaration
public bool ThemesEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
ThemeStyle
Gets or sets the NumericUpDownExtVisualStyle value used to customize the appearance of the NumericUpDownExt.
Declaration
public NumericUpDownExtVisualStyle ThemeStyle { get; set; }
Property Value
Type |
---|
NumericUpDownExtVisualStyle |
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
UpDownAlign
Gets or sets the alignment of the up and down buttons .
Declaration
public LeftRightAlignment UpDownAlign { get; set; }
Property Value
Type |
---|
System.Windows.Forms.LeftRightAlignment |
VisualStyle
Gets or sets visual style that is used for drawing a control.
Declaration
public VisualStyle VisualStyle { get; set; }
Property Value
Type |
---|
VisualStyle |
Methods
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | value to scale the factor based upon. |
Buttons_Paint(Object, PaintEventArgs)
Declaration
protected virtual void Buttons_Paint(object sender, PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Windows.Forms.PaintEventArgs | e |
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type |
---|
System.Windows.Forms.AccessibleObject |
DefWndProc(ref Message)
Sends the specified message to the default windows procedure.
Declaration
protected override void DefWndProc(ref Message msg)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | msg |
Dispose(Boolean)
Cleans up any resources being used.Disposes the themed drawing enabled for the control.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | if set to |
DrawOffice2007ButtonArrow(Graphics, Rectangle, ButtonID, ButtonState)
Declaration
protected virtual void DrawOffice2007ButtonArrow(Graphics g, Rectangle rect, ButtonID button, ButtonState state)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | |
System.Drawing.Rectangle | rect | |
ButtonID | button | |
System.Windows.Forms.ButtonState | state |
DrawOffice2007ButtonBackground(Graphics, Rectangle, ButtonID, ButtonState)
Declaration
protected virtual void DrawOffice2007ButtonBackground(Graphics g, Rectangle rect, ButtonID button, ButtonState state)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | |
System.Drawing.Rectangle | rect | |
ButtonID | button | |
System.Windows.Forms.ButtonState | state |
DrawOffice2007ButtonBorder(Graphics, Rectangle, ButtonID, ButtonState)
Declaration
protected virtual void DrawOffice2007ButtonBorder(Graphics g, Rectangle rect, ButtonID button, ButtonState state)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | |
System.Drawing.Rectangle | rect | |
ButtonID | button | |
System.Windows.Forms.ButtonState | state |
DrawOffice2007Buttons(Graphics)
Declaration
protected void DrawOffice2007Buttons(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g |
GetActiveThemeName()
Gets the active theme name of the control.
Declaration
public string GetActiveThemeName()
Returns
Type | Description |
---|---|
System.String | Returns the active theme name |
GetControlName(String)
Helps to override the ControlName property settings
Declaration
public virtual string GetControlName(string controlName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controlName | ControlName |
Returns
Type |
---|
System.String |
OnBackColorChanged(EventArgs)
Declaration
protected override void OnBackColorChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnBorder3DStyleChanged(EventArgs)
Raises the Border3DStyleChanged event.
Declaration
protected virtual void OnBorder3DStyleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorder3DStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorder3DStyleChanged in a derived class, be sure to call the base class's OnBorder3DStyleChanged method so that registered delegates receive the event.
OnBorderColorChanged(EventArgs)
Raises the BorderColorChanged event.
Declaration
protected virtual void OnBorderColorChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderColorChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorderColorChanged in a derived class, be sure to call the base class's OnBorderColorChanged method so that registered delegates receive the event.
OnBorderSidesChanged(EventArgs)
Raises the BorderSidesChanged event.
Declaration
protected virtual void OnBorderSidesChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderSidesChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OmBorderSidesChanged in a derived class, be sure to call the base class's OnBorderSidesChanged method so that registered delegates receive the event.
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 |
OnEnabledChanged(EventArgs)
Declaration
protected override void OnEnabledChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnFontChanged(EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event.
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
Remarks
Overridden.Updates the height of the control to the preferred height based on fontchange
OnGotFocus(EventArgs)
Raises the System.Windows.Forms.Control.GotFocus event.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
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 |
OnLayout(LayoutEventArgs)
Raises the System.Windows.Forms.Control.Layout event.
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.LayoutEventArgs | e | A System.Windows.Forms.LayoutEventArgs that contains the event data. |
Remarks
Overridden
OnLostFocus(EventArgs)
Raises the System.Windows.Forms.Control.LostFocus event.
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnMouseDown(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseDown event.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs that contains the event data. |
Remarks
Captures Up and Down buttons based on position
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 | A System.Windows.Forms.MouseEventArgs that contains the event data. |
OnMouseUp(MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseUp event.
Declaration
protected override void OnMouseUp(MouseEventArgs mevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | mevent | A System.Windows.Forms.MouseEventArgs that contains the event data. |
OnPaint(PaintEventArgs)
Raises the System.Windows.Forms.Control.Paint event.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | A System.Windows.Forms.PaintEventArgs that contains the event data. |
Remarks
Enables ThemedEditDrawing
OnReadOnlyChanged()
Raises ReadOnlyChanged event.Called inorder to set the buttons disabled when control edit portion is set to readonly.
Declaration
protected virtual void OnReadOnlyChanged()
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnTextBoxResize(Object, EventArgs)
Raises the System.Windows.Forms.Control.Resize event.
Declaration
protected override void OnTextBoxResize(object source, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | The source of the event. |
System.EventArgs | e | An System.EventArgs that contains the event data. |
Remarks
Updates the height of the control to the preferred height based on settings.
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public virtual void OnThemeNameChanged(string themeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeName | ThemeName |
OnValidated(EventArgs)
Raises the System.Windows.Forms.Control.Validated event.
Declaration
protected override void OnValidated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
PositionControls()
Positions child controls based on settings.
Declaration
protected virtual void PositionControls()
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. |
RaiseThemeChangedEvent(EventArgs)
Raises the ThemeChanged event.
Declaration
protected virtual void RaiseThemeChangedEvent(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
The RaiseThemeChangedEvent method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding RaiseThemeChangedEvent in a derived class, be sure to call the base class's RaiseThemeChangedEvent method so that registered delegates receive the event.
UpdateHeight()
Updates the height of the control to the preferred height based on settings.
Declaration
protected virtual void UpdateHeight()
WndProc(ref Message)
Overridden. See System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
Declaration
protected override void WndProc(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | Parameter messsage |
Events
Border3DStyleChanged
Occurs when Border3DStyle property is changed.
Declaration
public event EventHandler Border3DStyleChanged
Event Type
Type |
---|
System.EventHandler |
BorderColorChanged
Occurs when BorderColor property is changed.
Declaration
public event EventHandler BorderColorChanged
Event Type
Type |
---|
System.EventHandler |
BorderSidesChanged
Occurs when BorderSides property is changed.
Declaration
public event EventHandler BorderSidesChanged
Event Type
Type |
---|
System.EventHandler |
ReadOnlyChanged
Occurs when a ReadOnly is changed.
Declaration
public event EventHandler ReadOnlyChanged
Event Type
Type |
---|
System.EventHandler |
ThemeChanged
Fired when the ThemesEnabled property is changed.
Declaration
public event EventHandler ThemeChanged
Event Type
Type |
---|
System.EventHandler |
ThemeNameChanged
Occurs when theme name of the control has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
Type |
---|
ThemeChangedEventHandler |
Explicit Interface Implementations
INonClientPaintingSupport.NonClientPaint(PaintEventArgs, Rectangle, Rectangle)
Declaration
IntPtr INonClientPaintingSupport.NonClientPaint(PaintEventArgs e, Rectangle displayRect, Rectangle windowRectInScreen)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | |
System.Drawing.Rectangle | displayRect | |
System.Drawing.Rectangle | windowRectInScreen |
Returns
Type |
---|
System.IntPtr |
ISupportOffice2007Theme.EnableOffice2007Style()
Declaration
void ISupportOffice2007Theme.EnableOffice2007Style()
ISupportOffice2007Theme.Office2007ColorTheme
Declaration
Office2007Theme ISupportOffice2007Theme.Office2007ColorTheme { get; set; }
Returns
Type |
---|
Office2007Theme |
IVisualStyle.VisualTheme
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 |