Articles in this section
Category / Section

How to change the selection color for integer textbox in WPF?

Selection color of IntegerTextBox can be changed by SelectionBrush property.

The same has been explained in the following code snippet:

XAML:

//Code explains how to change the selection  color for integer textbox
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="UndoLimit.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<syncfusion:IntegerTextBox Name="integer" SelectionBrush="Orange" MinWidth="100"  Width="100"  Value="5000"/>
</Grid>
</Window>

C#:

//Code explains how to change the selection  color for integer textbox
namespace UndoLimit
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
integer.SelectionBrush = Brushes.Orange;
}
}
}

Output:

C:\Users\Ashok.Murugesan\Desktop\Navigation\Selectionbrush.png

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied