Class RDFormsTextBox
A VB TextBox: a Avalonia.Controls.TextBox that shows a TextBox component.
public sealed class RDFormsTextBox : TextBox, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, INamed, IInputElement, IDataTemplateHost, ISetterValue
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlTextBoxRDFormsTextBox
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentINamedIInputElementIDataTemplateHostISetterValue
- Inherited Members
-
TextBox.IsInactiveSelectionHighlightEnabledPropertyTextBox.ClearSelectionOnLostFocusPropertyTextBox.AcceptsReturnPropertyTextBox.AcceptsTabPropertyTextBox.CaretIndexPropertyTextBox.IsReadOnlyPropertyTextBox.PasswordCharPropertyTextBox.SelectionBrushPropertyTextBox.SelectionForegroundBrushPropertyTextBox.CaretBrushPropertyTextBox.CaretBlinkIntervalPropertyTextBox.SelectionStartPropertyTextBox.SelectionEndPropertyTextBox.MaxLengthPropertyTextBox.MaxLinesPropertyTextBox.MinLinesPropertyTextBox.TextPropertyTextBox.TextAlignmentPropertyTextBox.HorizontalContentAlignmentPropertyTextBox.VerticalContentAlignmentPropertyTextBox.TextWrappingPropertyTextBox.LineHeightPropertyTextBox.PlaceholderTextPropertyTextBox.WatermarkPropertyTextBox.UseFloatingPlaceholderPropertyTextBox.UseFloatingWatermarkPropertyTextBox.PlaceholderForegroundPropertyTextBox.WatermarkForegroundPropertyTextBox.NewLinePropertyTextBox.InnerLeftContentPropertyTextBox.InnerRightContentPropertyTextBox.RevealPasswordPropertyTextBox.CanCutPropertyTextBox.CanCopyPropertyTextBox.CanPastePropertyTextBox.IsUndoEnabledPropertyTextBox.UndoLimitPropertyTextBox.CanUndoPropertyTextBox.CanRedoPropertyTextBox.CopyingToClipboardEventTextBox.CuttingToClipboardEventTextBox.PastingFromClipboardEventTextBox.TextChangedEventTextBox.TextChangingEventTextBox.ClearSelection()TextBox.GetLineCount()TextBox.Cut()TextBox.Copy()TextBox.Paste()TextBox.Clear()TextBox.SelectAll()TextBox.Undo()TextBox.Redo()TextBox.CutGestureTextBox.CopyGestureTextBox.PasteGestureTextBox.IsInactiveSelectionHighlightEnabledTextBox.ClearSelectionOnLostFocusTextBox.AcceptsReturnTextBox.AcceptsTabTextBox.CaretIndexTextBox.IsReadOnlyTextBox.PasswordCharTextBox.SelectionBrushTextBox.SelectionForegroundBrushTextBox.CaretBrushTextBox.CaretBlinkIntervalTextBox.SelectionStartTextBox.SelectionEndTextBox.MaxLengthTextBox.MaxLinesTextBox.MinLinesTextBox.LineHeightTextBox.TextTextBox.SelectedTextTextBox.HorizontalContentAlignmentTextBox.VerticalContentAlignmentTextBox.TextAlignmentTextBox.PlaceholderTextTextBox.WatermarkTextBox.UseFloatingPlaceholderTextBox.UseFloatingWatermarkTextBox.PlaceholderForegroundTextBox.WatermarkForegroundTextBox.InnerLeftContentTextBox.InnerRightContentTextBox.RevealPasswordTextBox.TextWrappingTextBox.NewLineTextBox.CanCutTextBox.CanCopyTextBox.CanPasteTextBox.IsUndoEnabledTextBox.UndoLimitTextBox.CanUndoTextBox.CanRedoTextBox.CopyingToClipboardTextBox.CuttingToClipboardTextBox.PastingFromClipboardTextBox.TextChangedTextBox.TextChangingTemplatedControl.BackgroundPropertyTemplatedControl.BackgroundSizingPropertyTemplatedControl.BorderBrushPropertyTemplatedControl.BorderThicknessPropertyTemplatedControl.CornerRadiusPropertyTemplatedControl.FontFamilyPropertyTemplatedControl.FontFeaturesPropertyTemplatedControl.FontSizePropertyTemplatedControl.FontStylePropertyTemplatedControl.FontWeightPropertyTemplatedControl.FontStretchPropertyTemplatedControl.ForegroundPropertyTemplatedControl.LetterSpacingPropertyTemplatedControl.PaddingPropertyTemplatedControl.TemplatePropertyTemplatedControl.IsTemplateFocusTargetPropertyTemplatedControl.TemplateAppliedEventTemplatedControl.GetIsTemplateFocusTarget(Control)TemplatedControl.ApplyTemplate()TemplatedControl.BackgroundTemplatedControl.BackgroundSizingTemplatedControl.BorderBrushTemplatedControl.BorderThicknessTemplatedControl.CornerRadiusTemplatedControl.FontFamilyTemplatedControl.FontFeaturesTemplatedControl.FontSizeTemplatedControl.FontStyleTemplatedControl.FontWeightTemplatedControl.FontStretchTemplatedControl.ForegroundTemplatedControl.LetterSpacingTemplatedControl.PaddingTemplatedControl.TemplateTemplatedControl.TemplateAppliedControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.GettingFocusEventInputElement.LostFocusEventInputElement.LosingFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.ContextRequestedEventInputElement.ContextCanceledEventInputElement.IsHoldingEnabledPropertyInputElement.IsHoldWithMouseEnabledPropertyInputElement.PinchEventInputElement.PinchEndedEventInputElement.PullGestureEventInputElement.PullGestureEndedEventInputElement.SwipeGestureEventInputElement.SwipeGestureEndedEventInputElement.ScrollGestureEventInputElement.ScrollGestureInertiaStartingEventInputElement.ScrollGestureEndedEventInputElement.PointerTouchPadGestureMagnifyEventInputElement.PointerTouchPadGestureRotateEventInputElement.PointerTouchPadGestureSwipeEventInputElement.TappedEventInputElement.RightTappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.GetIsHoldingEnabled(StyledElement)InputElement.GetIsHoldWithMouseEnabled(StyledElement)InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.GestureRecognizersInputElement.GotFocusInputElement.GettingFocusInputElement.LostFocusInputElement.LosingFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.ContextRequestedInputElement.ContextCanceledInputElement.PinchInputElement.PinchEndedInputElement.PullGestureInputElement.PullGestureEndedInputElement.ScrollGestureInputElement.ScrollGestureInertiaStartingInputElement.ScrollGestureEndedInputElement.PointerTouchPadGestureMagnifyInputElement.PointerTouchPadGestureRotateInputElement.SwipeGestureInputElement.SwipeGestureEndedInputElement.PointerTouchPadGestureSwipeInputElement.TappedInputElement.RightTappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.CacheModePropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.Render(DrawingContext)Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.CacheModeVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.Bind(AvaloniaProperty, BindingBase)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.DispatcherAvaloniaObject.PropertyChanged
Remarks
The component's Text is the box's: typing sets it, and a change to it from code shows in the box. Change is raised
from the component's Text, whichever way it changed, and only when it changed, except that each step of a SelText
raises one, whether or not it changed the text.
The component's SelStart and SelLength are the box's selection: a selection set from code shows in the box, and the
user's sets them.
It raises KeyDown, KeyPress and KeyUp. A character typed is a KeyPress first, with its KeyAscii: a handler that sets it to
0 cancels the character, and one that sets another code types that character instead. Backspace is KeyAscii 8, and Ctrl+A is 1.
Where its form's KeyPreview is True, the form raises each of them first: a KeyCode the form sets to 0 in KeyDown raises no
KeyDown on the box, and the box's KeyPress has the KeyAscii the form's left.
It raises Click, DblClick, GotFocus, LostFocus, MouseDown, MouseMove and MouseUp, MouseUp before Click.
Constructors
RDFormsTextBox(ComponentInstance)
Creates a box that shows a TextBox.
public RDFormsTextBox(ComponentInstance instance)
Parameters
instanceComponentInstanceThe TextBox.
Exceptions
- ArgumentNullException
instanceis null.- ArgumentException
instanceis not a TextBox.
Properties
SelLength
The component's SelLength: the number of characters selected, from SelStart.
public int SelLength { get; set; }
Property Value
Remarks
A value past the end of the text selects up to the end.
Exceptions
- FormErrorException
Set below 0 or above 65535: 380, Invalid property value.
SelStart
The component's SelStart: where the selection starts, or the caret's place where nothing is selected; 0 is before the
first character.
public int SelStart { get; set; }
Property Value
Remarks
A value past the end of the text puts the caret at the end. Setting it selects nothing.
Exceptions
- FormErrorException
Set below 0 or above 65535: 380, Invalid property value.
SelText
The component's SelText: the selected text; "" where nothing is selected.
public string SelText { get; set; }
Property Value
Remarks
Setting it puts the text in place of the selection, or at the caret, and the caret after it, with nothing selected. Where the
box has a MaxLength, what does not fit is left out. A Locked box takes it too. A single-line box raises Change
once, even where its text does not change, and none where nothing is selected and a text other than "" does not fit at all. A
multi-line box takes it in two steps, each with its Change: the selection is deleted, where there is one, then the text is
inserted, where some of it fits.
Exceptions
- ArgumentNullException
Set to null.
StyleKeyOverride
Gets the type by which the element is styled.
protected override Type StyleKeyOverride { get; }
Property Value
Remarks
Usually controls are styled by their own type, but there are instances where you want an element to be styled by its base type, e.g. creating SpecialButton that derives from Button and adds extra functionality but is still styled as a regular Button. Override this property to change the style for a control class, returning the type that you wish the elements to be styled as.
Methods
OnKeyDown(KeyEventArgs)
Invoked when an unhandled Avalonia.Input.InputElement.KeyDownEvent reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
eKeyEventArgsData about the event.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
changeAvaloniaPropertyChangedEventArgsThe property change details.
OnTextInput(TextInputEventArgs)
Invoked when an unhandled Avalonia.Input.InputElement.TextInputEvent reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnTextInput(TextInputEventArgs e)
Parameters
eTextInputEventArgsData about the event.