wpf-devexpress-dot-xpf-dot-editors.md
A text editor.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
[DXLicenseWpfEditors]
public class TextEdit :
TextEditBase,
ISupportTextHighlighting
<DXLicenseWpfEditors>
Public Class TextEdit
Inherits TextEditBase
Implements ISupportTextHighlighting
The TextEdit is initially a single-line text editor. To enable multi-line editing, set the TextEditBase.TextWrapping property to Wrap.
Tip
The TextEdit class inherits its features from the TextEditBase class.
Refer to the TextEditBase class description for information on derived features and API.
To specify the editor’s value, use the BaseEdit.EditValue or TextEditBase.Text property.
<Window ...
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<!-- Use the TextEditBase.Text property to specify a value -->
<dxe:TextEdit Text="Hello World!"/>
<!-- Use the BaseEdit.EditValue property to specify a value -->
<dxe:TextEdit EditValue="Hello World!"/>
To respond to editor value changes, handle the BaseEdit.EditValueChanged event. To validate the new value, handle the BaseEdit.Validate event.
If the CharacterCasing property is set to Upper or Lower, the editor’s new values will be automatically converted to the corresponding case.
The TextEdit allows you to use masks when text is edited. To learn more, see the following help topic: Masked Input.
To enable automatic text selection when the keyboard is used to focus an editor, set the SelectAllOnGotFocus property to true. To enable text selection when a mouse click focuses an editor, set the SelectAllOnMouseUp to true.
To select all text within an editor manually, use the SelectAll method. To select only specified text, use the TextEdit.Select(System.Int32,System.Int32) method.
When an end user double-clicks a word in a text edit, the focused word is selected. When an end user clicks 3 times, all the editor’s text is selected (that is the same as calling the SelectAll method).
You can use the TextEdit.AllowSpin property to specify whether a user can use a spin editor to change an editor value with Up and Down keys.
When TextEdit.AllowSpin is true , use the TextEdit.AllowSpinOnMouseWheel property to specify whether a user can spin the mouse wheel to change an editor value.
The TextEdit.SpinUp method is in effect if the editor’s TextEdit.MaskType property is set to MaskType.Numeric or MaskType.DateTime.
To decrement the editor value, use the TextEdit.SpinDown method. If you call the TextEdit.SpinUp or TextEdit.SpinDown method, the TextEdit.Spin event is fired.
To embed a TextEdit into a container control, use the TextEditSettings class.
<Window ...
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<dxe:TextEdit NullTextForeground="#FFACACAC" NullText="Input a Name" Text="William" Foreground="#FF505050"
Background="#FFE9EBEC" CornerRadius="14" BorderBrush="#FF0D3A50" BorderThickness="2" />
</Window>
Tip
Refer to the following topic for more information: Appearance Customization.
The following code snippets (auto-collected from DevExpress Examples) contain references to the TextEdit class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
<dxd:LayoutControlItem Name="incidentNumber" Caption="Incident Number" VerticalAlignment="Top">
<dxe:TextEdit/>
</dxd:LayoutControlItem>
reporting-wpf-print-listview-data/CS/Window1.xaml#L13
<Style x:Key="headerTextStyle" TargetType="dxe:TextEdit">
<Setter Property="IsPrintingMode" Value="true" />
wpf-synchronous-theme-preload-with-splashscreen/CS/ThemePreloadwithSplashscreen/MainWindow.xaml#L16
VerticalAlignment="Center">
<dxe:TextEdit NullText="login" />
<dxe:PasswordBoxEdit Margin="0,10" NullText="password" />
<dxlc:LayoutItem Label="Patient name:">
<dxe:TextEdit x:Name="subjectEdit" EditValue="{Binding Subject, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</dxlc:LayoutItem>
reporting-wpf-stretch-detail-area-to-fill-the-page/CS/Window1.xaml#L14
<DataTemplate x:Key="pageHeader">
<dxe:TextEdit Text="This is a page header" Background="LightGray" Height="{StaticResource pageHeaderHeight}" />
</DataTemplate>
Show 32 items
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control BaseEdit TextEditBase TextEdit ButtonEdit
See Also