WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PercentTextBox - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PercentTextBox

    Extends the System.Windows.Forms.TextBox class to handle percentage input and validation.

    Inheritance
    System.Object
    TextBoxExt
    NumberTextBoxBase
    PercentTextBox
    GridPercentTextBox
    Implements
    IThemeProvider
    System.ComponentModel.ISupportInitialize
    System.Runtime.Serialization.ISerializable
    IVisualStyle
    Inherited Members
    NumberTextBoxBase.ignoreTextChange
    NumberTextBoxBase.rollBackOperation
    NumberTextBoxBase.initNumberFormatInfoObject
    NumberTextBoxBase.supressKeyPress
    NumberTextBoxBase.m_bDecimalMode
    NumberTextBoxBase.EndInit()
    NumberTextBoxBase.RaiseValidationError(String, Int32)
    NumberTextBoxBase.RaiseValidationError(String, Int32, String)
    NumberTextBoxBase.OnValidationError(ValidationErrorArgs)
    NumberTextBoxBase.RefreshCulture()
    NumberTextBoxBase.ApplyRightToLeft()
    NumberTextBoxBase.ResetRightToLeft()
    NumberTextBoxBase.ResetForeColor()
    NumberTextBoxBase.ShouldSerializeNegativeSign()
    NumberTextBoxBase.GetCopyOfCurrentNumberFormatInfo()
    NumberTextBoxBase.ShouldSerializeNegativeColor()
    NumberTextBoxBase.ResetNegativeColor()
    NumberTextBoxBase.ShouldSerializeZeroColor()
    NumberTextBoxBase.ResetZeroColor()
    NumberTextBoxBase.ShouldSerializePositiveColor()
    NumberTextBoxBase.ResetPositiveColor()
    NumberTextBoxBase.OnBindableValueChanged(EventArgs)
    NumberTextBoxBase.OnControlValidated(String, String)
    NumberTextBoxBase.SetDefaultValue(Object)
    NumberTextBoxBase.SetControlColor()
    NumberTextBoxBase.ApplyFormattingAndSetText(String)
    NumberTextBoxBase.SetModifiedText(String, String)
    NumberTextBoxBase.SetTextBoxText(String)
    NumberTextBoxBase.GetTextBoxText()
    NumberTextBoxBase.GetTextBoxTextLength()
    NumberTextBoxBase.RemoveFormatting(String)
    NumberTextBoxBase.RemoveFormatting(String, Boolean)
    NumberTextBoxBase.RemoveFormatting(String, NumberFormatInfo)
    NumberTextBoxBase.ResetControlBackColor()
    NumberTextBoxBase.ResetReadOnlyBackColor()
    NumberTextBoxBase.OnBackColorChanged(EventArgs)
    NumberTextBoxBase.OnReadOnlyChanged(EventArgs)
    NumberTextBoxBase.GetClipText()
    NumberTextBoxBase.GetClipText(Boolean)
    NumberTextBoxBase.OnClipTextChanged(EventArgs)
    NumberTextBoxBase.OnFormattedTextChanged(EventArgs)
    NumberTextBoxBase.Undo()
    NumberTextBoxBase.SelectAll()
    NumberTextBoxBase.Copy()
    NumberTextBoxBase.Cut()
    NumberTextBoxBase.Delete()
    NumberTextBoxBase.GetZeroNegative()
    NumberTextBoxBase.SetNegativeInputPending(Boolean)
    NumberTextBoxBase.GetNegativeInputPending()
    NumberTextBoxBase.SetZeroNegative(Boolean)
    NumberTextBoxBase.GetStartPositionJustNumbers(String, Int32)
    NumberTextBoxBase.IsValidCharacter(Char)
    NumberTextBoxBase.ParseForNegativeFormat(String)
    NumberTextBoxBase.SetEmptySelection(Int32)
    NumberTextBoxBase.GetFirstDataPos()
    NumberTextBoxBase.GetNextDataPos(Int32, Boolean, Boolean, Boolean)
    NumberTextBoxBase.GetDecimalSeparatorPosition(String)
    NumberTextBoxBase.GetDecimalSeparatorPosition(String, NumberFormatInfo)
    NumberTextBoxBase.GetPrevDataPos(Int32)
    NumberTextBoxBase.GetDecimalSeparator()
    NumberTextBoxBase.GetGroupSeparator()
    NumberTextBoxBase.DeleteSelectedText(String, Int32, Int32)
    NumberTextBoxBase.DeleteSelectedText()
    NumberTextBoxBase.CanInsert(String, String, Int32)
    NumberTextBoxBase.CheckForMinMax(String)
    NumberTextBoxBase.CheckNullStringIsInRange(String)
    NumberTextBoxBase.GetNumberPartLength(String)
    NumberTextBoxBase.InsertString(String, Int32, Int32, String)
    NumberTextBoxBase.InsertString(String, Int32, Int32, String, Boolean)
    NumberTextBoxBase.ConcatModifiedText(String, String, String)
    NumberTextBoxBase.CompleteInsertString(NumberModifyState)
    NumberTextBoxBase.CheckDecimalPartLength(String)
    NumberTextBoxBase.GetInitialZeroCount(String, Int32)
    NumberTextBoxBase.IsInDecimalPosition(String, Int32)
    NumberTextBoxBase.IsValidNumberValue(String)
    NumberTextBoxBase.OnSetNull(SetNullEventArgs)
    NumberTextBoxBase.OnKeyValidate(KeyValidateEventArgs)
    NumberTextBoxBase.RaiseSetNull(Object)
    NumberTextBoxBase.RaiseKeyValidate(Char, String, String)
    NumberTextBoxBase.ProcessKeyMessage(Message)
    NumberTextBoxBase.ProcessKeyEventArgs(Message)
    NumberTextBoxBase.SetPreserveData(Boolean)
    NumberTextBoxBase.GetPreserveData()
    NumberTextBoxBase.IsDataPosition(String, Int32)
    NumberTextBoxBase.CursorShouldBeMoved(Int32, Boolean)
    NumberTextBoxBase.PositionCursorAfterEdit(Int32, Boolean, Boolean, Boolean)
    NumberTextBoxBase.OnMouseDown(MouseEventArgs)
    NumberTextBoxBase.WndProc(Message)
    NumberTextBoxBase.EnforceMinMaxDuringValidating
    NumberTextBoxBase.Culture
    NumberTextBoxBase.SpecialCultureValue
    NumberTextBoxBase.CurrentCultureRefresh
    NumberTextBoxBase.UseUserOverride
    NumberTextBoxBase.UseNullString
    NumberTextBoxBase.RightToLeft
    NumberTextBoxBase.BackColor
    NumberTextBoxBase.NumberFormatInfoObject
    NumberTextBoxBase.NegativeSign
    NumberTextBoxBase.NegativeColor
    NumberTextBoxBase.ZeroColor
    NumberTextBoxBase.PositiveColor
    NumberTextBoxBase.NullFormat
    NumberTextBoxBase.NullString
    NumberTextBoxBase.BindableValue
    NumberTextBoxBase.DefaultValue
    NumberTextBoxBase.OverWriteText
    NumberTextBoxBase.MinMaxValidation
    NumberTextBoxBase.MaxLength
    NumberTextBoxBase.OnValidationFailed
    NumberTextBoxBase.IsNull
    NumberTextBoxBase.NullState
    NumberTextBoxBase.BackGroundColor
    NumberTextBoxBase.ReadOnlyBackColor
    NumberTextBoxBase.ClipMode
    NumberTextBoxBase.ReturnBaseText
    NumberTextBoxBase.CanUndo
    NumberTextBoxBase.IsNegative
    NumberTextBoxBase.NegativeInputPendingOnSelectAll
    NumberTextBoxBase.SelectAllOnFocus
    NumberTextBoxBase.SelectedText
    NumberTextBoxBase.ForeColor
    NumberTextBoxBase.SetNull
    NumberTextBoxBase.KeyValidate
    NumberTextBoxBase.ValidationError
    NumberTextBoxBase.BindableValueChanged
    NumberTextBoxBase.ControlValidated
    NumberTextBoxBase.ClipTextChanged
    NumberTextBoxBase.FormattedTextChanged
    TextBoxExt.ApplyScaleToControl(Single)
    TextBoxExt.GetActiveThemeName()
    TextBoxExt.OnMaximumSizeChanged(EventArgs)
    TextBoxExt.OnMouseEnter(EventArgs)
    TextBoxExt.OnMouseLeave(EventArgs)
    TextBoxExt.DefWndProc(Message)
    TextBoxExt.OnFontChanged(EventArgs)
    TextBoxExt.OnMinimumSizeChanged(EventArgs)
    TextBoxExt.OnCharacterCasingChanged(EventArgs)
    TextBoxExt.OnBorderSidesChanged(EventArgs)
    TextBoxExt.OnBorderColorChanged(EventArgs)
    TextBoxExt.OnBorder3DStyleChanged(EventArgs)
    TextBoxExt.RaiseThemeChanged(Object, ThemeChangedEventArgs)
    TextBoxExt.OnCanApplyThemeChanged(Boolean)
    TextBoxExt.OnCanOverrideStyleChanged(Boolean)
    TextBoxExt.OnThemesEnabledChanged(EventArgs)
    TextBoxExt.OnParentChanged(EventArgs)
    TextBoxExt.OnPaint(PaintEventArgs)
    TextBoxExt.OnHandleCreated(EventArgs)
    TextBoxExt.OnHandleDestroyed(EventArgs)
    TextBoxExt.OnMultilineChanged(EventArgs)
    TextBoxExt.NCOverflowIndicatorPaint(Graphics, Rectangle, Rectangle)
    TextBoxExt.OnSizeChanged(EventArgs)
    TextBoxExt.OnBorderStyleChanged(EventArgs)
    TextBoxExt.OnLostFocus(EventArgs)
    TextBoxExt.BeginInit()
    TextBoxExt.ISerializable.GetObjectData(SerializationInfo, StreamingContext)
    TextBoxExt.IThemeProvider.BaseThemeName
    TextBoxExt.ControlName
    TextBoxExt.IsVisualStyleEnabled
    TextBoxExt.BeforeTouchSize
    TextBoxExt.EnableTouchMode
    TextBoxExt.CreateParams
    TextBoxExt.Metrocolor
    TextBoxExt.FocusBorderColor
    TextBoxExt.UseBorderColorOnFocus
    TextBoxExt.ShowOverflowIndicatorToolTip
    TextBoxExt.OverflowIndicatorToolTipText
    TextBoxExt.ShowOverflowIndicator
    TextBoxExt.DrawActiveWhenDisabled
    TextBoxExt.BorderSides
    TextBoxExt.Border3DStyle
    TextBoxExt.BorderColor
    TextBoxExt.OverflowIndicatorToolTip
    TextBoxExt.ThemesEnabled
    TextBoxExt.MaximumSize
    TextBoxExt.MinimumSize
    TextBoxExt.CharacterCasing
    TextBoxExt.CornerRadius
    TextBoxExt.NearImage
    TextBoxExt.ThemeName
    TextBoxExt.FarImage
    TextBoxExt.CanOverrideStyle
    TextBoxExt.CanApplyTheme
    TextBoxExt.Style
    TextBoxExt.IVisualStyle.VisualTheme
    TextBoxExt.Office2010ColorScheme
    TextBoxExt.Office2010ColorTable
    TextBoxExt.Office2007ColorScheme
    TextBoxExt.Office2007ColorTable
    TextBoxExt.Initializing
    TextBoxExt.BorderSidesChanged
    TextBoxExt.Border3DStyleChanged
    TextBoxExt.ThemeNameChanged
    TextBoxExt.BorderColorChanged
    TextBoxExt.ThemesEnabledChanged
    TextBoxExt.MaximumSizeChanged
    TextBoxExt.MinimumSizeChanged
    TextBoxExt.CharacterCasingChanged
    Namespace: Syncfusion.Windows.Forms.Tools
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class PercentTextBox : NumberTextBoxBase, IThemeProvider, ISupportInitialize, ISerializable, IVisualStyle
    Remarks

    The PercentTextBox is derived from the textbox and provides all the functionality of a textbox and adds additional functionality of its own.

    Collecting percentage input in a consistent format requires validation that needs to be built into the application when using the Windows Forms textbox control. The PercentTextBox includes all this logic into its methods and properties and makes it easy for the developer and the end user to collect and enter percentage data.

    The PercentTextBox is also closely tied to the globalization settings of the operating system for pecentage-related properties. Please refer to the System.Globalization.NumberFormatInfo class for a detailed explanation of globalization and percent-related attributes.

    The PercentTextBox has full support for the Windows Forms designer and you can just drag-and-drop and set properties on the control just as you would with the Windows Forms textbox.

    The PercentTextBox also raises a ValidationError event when inappropriate data is entered into the control.

    All clipboard functions such as copy, paste, and cut are also supported with special accomodations for percent-related issues.

    Constructors

    PercentTextBox()

    Overloaded. Creates an object of type PercentTextBox.

    Declaration
    public PercentTextBox()
    Remarks

    The PercentTextBox object will be initialized with the default values for the display and data properties. You need to set any specific values.

    Properties

    AllowNull

    Gets or sets the NULL string to be displayed.

    Declaration
    public override bool AllowNull { get; set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.AllowNull

    BindablePercentValue

    Wrapper property around the selected value. Use this property if you want to be able to set the value of the control to NULL.

    Declaration
    public object BindablePercentValue { get; set; }
    Property Value
    Type Description
    System.Object

    ClipText

    Returns the clipped text without the formatting.

    Declaration
    public override string ClipText { get; }
    Property Value
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.ClipText
    Remarks

    For example, if the Text in the CurrencyTextBox is $45,000.00, the ClipText property will give 45000.00.

    DoubleValue

    Gets / sets the double value of the control. This will be formatted and displayed.

    Declaration
    public double DoubleValue { get; set; }
    Property Value
    Type Description
    System.Double

    FormattedText

    Declaration
    public override string FormattedText { get; }
    Property Value
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.FormattedText

    MaxValue

    Gets / sets the maximum value that can be set through the PercentTextBox.

    Declaration
    public double MaxValue { get; set; }
    Property Value
    Type Description
    System.Double

    MinValue

    Gets / sets the minimum value that can be set through the PercentTextBox.

    Declaration
    public double MinValue { get; set; }
    Property Value
    Type Description
    System.Double

    PercentDecimalDigits

    Gets / sets the maximum number of digits for the decimal portion of the percentage.

    Declaration
    public int PercentDecimalDigits { get; set; }
    Property Value
    Type Description
    System.Int32
    Remarks

    If there is a need to have a different value based on the locale, it will be automatically changed if the UseLocaleDefault property is True.

    PercentDecimalSeparator

    Gets / sets the decimal separator character that will be used for the display.

    Declaration
    public string PercentDecimalSeparator { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentGroupSeparator

    Gets / sets the separator to be used for grouping digits.

    Declaration
    public string PercentGroupSeparator { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentGroupSizes

    Gets / sets the grouping of PercentDigits in the PercentTextBox.

    Declaration
    public int[] PercentGroupSizes { get; set; }
    Property Value
    Type Description
    System.Int32[]
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentNegativePattern

    Gets / sets the pattern to use when the value is negative.

    Declaration
    public int PercentNegativePattern { get; set; }
    Property Value
    Type Description
    System.Int32
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentNegativePatterns

    The negative patterns.

    Declaration
    protected string[] PercentNegativePatterns { get; set; }
    Property Value
    Type Description
    System.String[]

    PercentPositivePattern

    Gets / sets the pattern to use when the value is positive.

    Declaration
    public int PercentPositivePattern { get; set; }
    Property Value
    Type Description
    System.Int32
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentSymbol

    Gets / sets the percent symbol to be used in the PercentTextBox.

    Declaration
    public string PercentSymbol { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This value is initially set from the System.Globalization.NumberFormatInfo and can be changed based on your requirements or based on the locale.

    PercentValue

    Gets / sets the percent value of the control. This will be formatted and displayed.

    Declaration
    public double PercentValue { get; set; }
    Property Value
    Type Description
    System.Double

    SwitchModeOnFocus

    Indicates whether the PercentTextBox should allow editing in numeric mode when it receives focus.

    Declaration
    public bool SwitchModeOnFocus { get; set; }
    Property Value
    Type Description
    System.Boolean

    Text

    Overrides the Text property of System.Windows.Forms.TextBox.

    Declaration
    public override string Text { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    This property is overriden in order to normalize the data that is set to the Text property and format it as needed. The method InsertString(String, Int32, Int32, String) is used to format the data.

    ThemeStyle

    Declaration
    public PercentTextBoxVisualStyle ThemeStyle { get; set; }
    Property Value
    Type Description
    PercentTextBoxVisualStyle

    Methods

    ApplyFormatting(String)

    Formats the given text according to the current setting.

    Declaration
    protected override string ApplyFormatting(string rawValue)
    Parameters
    Type Name Description
    System.String rawValue
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.ApplyFormatting(String)

    CheckForMinMax(String, Boolean)

    Declaration
    protected override bool CheckForMinMax(string currentTextValue, bool ignoreLength)
    Parameters
    Type Name Description
    System.String currentTextValue
    System.Boolean ignoreLength
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.CheckForMinMax(String, Boolean)

    CheckIfNegative(String)

    Declaration
    protected override bool CheckIfNegative(string rawValue)
    Parameters
    Type Name Description
    System.String rawValue
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.CheckIfNegative(String)

    CheckIsZero()

    Declaration
    protected override bool CheckIsZero()
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.CheckIsZero()

    CompleteSubtractKey(NumberModifyState)

    Declaration
    protected override bool CompleteSubtractKey(NumberModifyState state)
    Parameters
    Type Name Description
    NumberModifyState state
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.CompleteSubtractKey(NumberModifyState)

    CreateAccessibilityInstance()

    Declaration
    protected override AccessibleObject CreateAccessibilityInstance()
    Returns
    Type Description
    System.Windows.Forms.AccessibleObject
    Overrides
    TextBoxExt.CreateAccessibilityInstance()

    Dispose(Boolean)

    Clean up any resources being used.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    NumberTextBoxBase.Dispose(Boolean)

    FormatChanged(String, NumberFormatInfo)

    Declaration
    protected override void FormatChanged(string currentText, NumberFormatInfo previousFormat)
    Parameters
    Type Name Description
    System.String currentText
    System.Globalization.NumberFormatInfo previousFormat
    Overrides
    NumberTextBoxBase.FormatChanged(String, NumberFormatInfo)

    GetAdjustedValue(Double)

    Declaration
    public virtual double GetAdjustedValue(double newValue)
    Parameters
    Type Name Description
    System.Double newValue
    Returns
    Type Description
    System.Double

    GetControlName(String)

    Helps to override the ThemeName property settings

    Declaration
    public override string GetControlName(string controlName)
    Parameters
    Type Name Description
    System.String controlName

    ThemeName

    Returns
    Type Description
    System.String
    Overrides
    TextBoxExt.GetControlName(String)

    GetDecimalDigits()

    Declaration
    protected override int GetDecimalDigits()
    Returns
    Type Description
    System.Int32
    Overrides
    NumberTextBoxBase.GetDecimalDigits()

    GetDecimalSeparator(NumberFormatInfo)

    Override this to return PercentDecimalSeparator in PercentTextBox.

    Declaration
    protected override string GetDecimalSeparator(NumberFormatInfo info)
    Parameters
    Type Name Description
    System.Globalization.NumberFormatInfo info
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.GetDecimalSeparator(NumberFormatInfo)

    GetGroupSeparator(NumberFormatInfo)

    Override this to return PercentGroupSeparator in PercentTextBox.

    Declaration
    protected override string GetGroupSeparator(NumberFormatInfo info)
    Parameters
    Type Name Description
    System.Globalization.NumberFormatInfo info
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.GetGroupSeparator(NumberFormatInfo)

    GetNumberPartLength(Double)

    Declaration
    protected int GetNumberPartLength(double numberValue)
    Parameters
    Type Name Description
    System.Double numberValue
    Returns
    Type Description
    System.Int32

    GetNumberValue(String, Int32)

    Declaration
    protected override string GetNumberValue(string formattedText, int startPosition)
    Parameters
    Type Name Description
    System.String formattedText
    System.Int32 startPosition
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.GetNumberValue(String, Int32)

    GetValue()

    Declaration
    protected override object GetValue()
    Returns
    Type Description
    System.Object
    Overrides
    NumberTextBoxBase.GetValue()

    HandleBackspaceKey()

    Declaration
    protected override bool HandleBackspaceKey()
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.HandleBackspaceKey()

    HandleBackspaceKeyChar()

    Declaration
    protected override bool HandleBackspaceKeyChar()
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.HandleBackspaceKeyChar()

    HandleCharacterKey(Char)

    Overrides the base behavior to implement support for NumberMode. In this mode, the base behavior of formatting each key is not followed. The key is validated internally to check for Max and Min conditions and then displayed as is without the formatting. The key will be ignored if the supressKeyPress value is not set to False. This is set to False when a valid key press is encountered.

    Declaration
    protected override bool HandleCharacterKey(char charToBeInserted)
    Parameters
    Type Name Description
    System.Char charToBeInserted
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.HandleCharacterKey(Char)

    HandleDecimalKey()

    Declaration
    protected override bool HandleDecimalKey()
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.HandleDecimalKey()

    HandleDeleteKey()

    Declaration
    protected override bool HandleDeleteKey()
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.HandleDeleteKey()

    HandleSubtractKey()

    Invoked when the negative key is pressed.

    Declaration
    protected override NumberModifyState HandleSubtractKey()
    Returns
    Type Description
    NumberModifyState

    True if the key is handled; false otherwise.

    Overrides
    NumberTextBoxBase.HandleSubtractKey()
    Remarks

    The defined behavior for this key is to toggle the sign (negativity) of the content of the CurrencyTextBox.

    InitializeNumberTextBox()

    Overrides InitializeNumberTextBox().

    Declaration
    protected override void InitializeNumberTextBox()
    Overrides
    NumberTextBoxBase.InitializeNumberTextBox()

    IsAssignable(Object)

    Declaration
    protected override bool IsAssignable(object val)
    Parameters
    Type Name Description
    System.Object val
    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.IsAssignable(Object)

    OnBindablePercentValueChanged(EventArgs)

    Raises the BindablePercentValueChanged event.

    Declaration
    protected virtual void OnBindablePercentValueChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    A System.EventArgs that contains the event data.

    OnDoubleValueChanged(EventArgs)

    Raises the DoubleValueChanged event.

    Declaration
    protected virtual void OnDoubleValueChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    A System.EventArgs that contains the event data.

    OnEnabledChanged(EventArgs)

    Raises the System.Windows.Forms.Control.EnabledChanged event.

    Declaration
    protected override void OnEnabledChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    Overrides
    TextBoxExt.OnEnabledChanged(EventArgs)

    OnEnter(EventArgs)

    Overrides the System.Windows.Forms.Control.OnEnter(System.EventArgs) method.

    Declaration
    protected override void OnEnter(EventArgs args)
    Parameters
    Type Name Description
    System.EventArgs args

    The event data.

    Overrides
    NumberTextBoxBase.OnEnter(EventArgs)
    Remarks

    Saves the current DoubleValue so that it can be compared during validation. The DoubleValueChanged and TextChanged event will only be raised if the value is different during validation. Also switches mode if the SwitchModeOnFocus property is set.

    OnGotFocus(EventArgs)

    Helps to override the OnGotFocus events

    Declaration
    protected override void OnGotFocus(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    Overrides
    TextBoxExt.OnGotFocus(EventArgs)

    OnLeave(EventArgs)

    Overrides the System.Windows.Forms.Control.OnLeave(System.EventArgs) method.

    Declaration
    protected override void OnLeave(EventArgs args)
    Parameters
    Type Name Description
    System.EventArgs args

    OnTextChanged(EventArgs)

    Overrides OnTextChanged.

    Declaration
    protected override void OnTextChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The event data.

    Overrides
    NumberTextBoxBase.OnTextChanged(EventArgs)

    OnThemeNameChanged(String)

    Helps to apply the ThemeName settings in control

    Declaration
    public override void OnThemeNameChanged(string themeName)
    Parameters
    Type Name Description
    System.String themeName

    ThemeName

    Overrides
    TextBoxExt.OnThemeNameChanged(String)

    OnValidated(EventArgs)

    Declaration
    protected override void OnValidated(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    OnValidating(CancelEventArgs)

    Declaration
    protected override void OnValidating(CancelEventArgs e)
    Parameters
    Type Name Description
    System.ComponentModel.CancelEventArgs e
    Overrides
    NumberTextBoxBase.OnValidating(CancelEventArgs)

    ParseForNegativeFormat(String, NumberFormatInfo)

    Overrides ParseForNegativeFormat(String).

    Declaration
    protected override bool ParseForNegativeFormat(string currentText, NumberFormatInfo info)
    Parameters
    Type Name Description
    System.String currentText

    The text to be parsed.

    System.Globalization.NumberFormatInfo info
    Returns
    Type Description
    System.Boolean

    True if the value is negative; false otherwise.

    Overrides
    NumberTextBoxBase.ParseForNegativeFormat(String, NumberFormatInfo)

    Paste()

    Pastes the data in the clipboard into the PercentTextBox control.

    Declaration
    public void Paste()
    Remarks

    The data will be formatted before being pasted into the text box.

    PrepareInsertString(String, Int32, Int32, String, Boolean)

    Declaration
    protected override NumberModifyState PrepareInsertString(string currentText, int startPosition, int selectionLength, string textToBeInserted, bool pasteOperation)
    Parameters
    Type Name Description
    System.String currentText
    System.Int32 startPosition
    System.Int32 selectionLength
    System.String textToBeInserted
    System.Boolean pasteOperation
    Returns
    Type Description
    NumberModifyState
    Overrides
    NumberTextBoxBase.PrepareInsertString(String, Int32, Int32, String, Boolean)

    RemoveFormatting(String, NumberFormatInfo, Boolean)

    Declaration
    protected override string RemoveFormatting(string formattedText, NumberFormatInfo info, bool padIfEmpty)
    Parameters
    Type Name Description
    System.String formattedText
    System.Globalization.NumberFormatInfo info
    System.Boolean padIfEmpty
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.RemoveFormatting(String, NumberFormatInfo, Boolean)

    ResetMaxValue()

    Resets the value to the default.

    Declaration
    public void ResetMaxValue()

    ResetMinValue()

    Resets the value to the default.

    Declaration
    public void ResetMinValue()

    ResetText()

    Restores the CurrencyNumberDigits to the MaximumLength.

    Declaration
    protected void ResetText()

    SetDoubleValue(Double)

    Declaration
    protected void SetDoubleValue(double newValue)
    Parameters
    Type Name Description
    System.Double newValue

    SetNullNumberValue()

    Declaration
    protected override void SetNullNumberValue()
    Overrides
    NumberTextBoxBase.SetNullNumberValue()

    SetNullState(Double)

    Declaration
    protected void SetNullState(double val)
    Parameters
    Type Name Description
    System.Double val

    SetPercentValue(Object)

    Declaration
    protected void SetPercentValue(object val)
    Parameters
    Type Name Description
    System.Object val

    SetTextProperty(String)

    Declaration
    protected override void SetTextProperty(string newText)
    Parameters
    Type Name Description
    System.String newText
    Overrides
    NumberTextBoxBase.SetTextProperty(String)

    SetValue(Object)

    Declaration
    protected override void SetValue(object val)
    Parameters
    Type Name Description
    System.Object val
    Overrides
    NumberTextBoxBase.SetValue(Object)

    ShouldSerializeMaxValue()

    Indicates whether the MaxValue property should be serialized.

    Declaration
    public bool ShouldSerializeMaxValue()
    Returns
    Type Description
    System.Boolean

    True if the value is not equal to System.Double.MaxValue.

    ShouldSerializeMinValue()

    Indicates whether the MinValue property should be serialized.

    Declaration
    public bool ShouldSerializeMinValue()
    Returns
    Type Description
    System.Boolean

    True if the value is not equal to System.Decimal.MaxValue.

    ShouldSerializePercentDecimalSeparator()

    Indicates whether the PercentDecimalSeparator should not be serialized if the UseLocaleDefault property is set.

    Declaration
    protected bool ShouldSerializePercentDecimalSeparator()
    Returns
    Type Description
    System.Boolean

    ShouldSerializePercentGroupSeparator()

    Indicates whether PercentGroupSeparator should not be serialized if the UseLocaleDefault property is set.

    Declaration
    protected bool ShouldSerializePercentGroupSeparator()
    Returns
    Type Description
    System.Boolean

    ShouldSerializePercentGroupSizes()

    Indicates whether the PercentGroupPattern should not be serialized if the UseLocaleDefault property is set.

    Declaration
    protected bool ShouldSerializePercentGroupSizes()
    Returns
    Type Description
    System.Boolean

    ShouldSerializeText()

    Indicates whether to serialize the Text property if it is null or quals NullString

    Declaration
    protected bool ShouldSerializeText()
    Returns
    Type Description
    System.Boolean

    ToggleNegative(String)

    Declaration
    protected override string ToggleNegative(string currentText)
    Parameters
    Type Name Description
    System.String currentText
    Returns
    Type Description
    System.String
    Overrides
    NumberTextBoxBase.ToggleNegative(String)

    Validate(Boolean)

    Validates the control.

    Declaration
    public override bool Validate(bool bRaiseValidationError)
    Parameters
    Type Name Description
    System.Boolean bRaiseValidationError

    Indicates whether the validation error is to be raised.

    Returns
    Type Description
    System.Boolean
    Overrides
    NumberTextBoxBase.Validate(Boolean)

    Events

    BindablePercentValueChanged

    Occurs when the BindableValue property is changed.

    Declaration
    public event EventHandler BindablePercentValueChanged
    Event Type
    Type Description
    System.EventHandler

    DoubleValueChanged

    Occurs when the DoubleValue property is changed.

    Declaration
    public event EventHandler DoubleValueChanged
    Event Type
    Type Description
    System.EventHandler

    Implements

    IThemeProvider
    System.ComponentModel.ISupportInitialize
    System.Runtime.Serialization.ISerializable
    IVisualStyle
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved