Arguments for events that handle when text is about to change, such as the TextBox.TextChanging event.
Remarks: To cancel the change, set the inherited CancelEventArgs.Cancel property to true.
Constructors
TextChangingEventArgs
#Initializes a new instance of the TextChangingEventArgs class.
Initializes a new instance of the TextChangingEventArgs class.
Parameters:
| oldText (string) | Old text for the control |
| newText (string) | New text for the control |
| source (TextChangeSource) | Value indicating how the change was initiated. |
TextChangingEventArgs
#Initializes a new instance of the TextChangingEventArgs class.
TextChangingEventArgs
#Initializes a new instance of the TextChangingEventArgs class.
public TextChangingEventArgs(string text, Range<int> range, string oldText, TextChangeSource source)
Initializes a new instance of the TextChangingEventArgs class.
Parameters:
| text (string) | Text to be replaced in the range. |
| range (Range<int>) | Range of text to be effected. |
| oldText (string) | Current text in the control. |
| source (TextChangeSource) | Value indicating how the change was initiated. |
Initializes a new instance of the TextChangingEventArgs class.
Parameters:
| text (string) | Text to be replaced in the range. |
| range (Range<int>) | Range of text to be effected. |
| source (TextChangeSource) | Value indicating how the change was initiated. |
Properties
FromUser
#Gets a value indicating that the change was initiated by the user, false when the change was made programmatically.
Remarks: This is a convenience that returns
true for any Source other than TextChangeSource.Programmatic. Use Source to determine how the user initiated the change (typing, paste, etc.).OldText
#Gets the entire old text for the control.
Remarks: This is the same as the TextControl.Text property of the control.
Value: The old text value.
Range
#Gets the range that the text will be replaced or deleted.
Gets a value indicating how the change was initiated, e.g. by typing, pasting, or programmatically.
Remarks: Some values are best-effort and platform dependent — see the TextChangeSource members.