Skip to main content

Posts

Showing posts with the label UWP TextBox

UWP - How to use TextBox SelectionChanged event

UWP - TextBox SelectionChanged Event The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The following Universal Windows Platform application development tutorial demonstrates how we can use the TextBox SelectionChanged event. Here we displayed the TextBox selected text on a TextBlock control when the TextBox selection changed. The TextBox SelectionChanged event occurs when the text selection has changed. The TextBox SelectionChanged event type is RoutedEventHandler. The RoutedEventHandler delegate represents the method that will handle routed events. The RoutedEventHandler(object sende...

UWP - How to use TextBox TextChanged event

UWP - TextBox TextChanged Event The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The following Universal Windows Platform application development tutorial demonstrates how we can use the TextBox TextChanged event. Here we displayed the TextBox entered text on a TextBlock control when the TextBox text changed. The TextBox TextChanged event Occurs when content changes in the text box. The TextBox TextChanged event type is TextChangedEventHandler. The TextChangedEventHandler delegate represents the method that will handle the TextChanged event. The TextChangedEventHandler(object sender,...

UWP - TextBox ScrollBar example

MainPage.xaml <Page x:Class="UniversalAppTutorials.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UniversalAppTutorials" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" > <StackPanel Padding="50" Background="AliceBlue"> <TextBox x:Name="TextBox1" PlaceholderText="Input some names here" Header="Names" Margin="5" AcceptsReturn="True" TextWrapping="Wrap" MaxHeight="100" ScrollViewer.VerticalScrollBarVisibility="Auto" /> <TextBox ...

UWP - How to change TextBox style

UWP - Change TextBox Style The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The following Universal Windows Platform application development tutorial demonstrates how we can set or change the TextBox styles. Here we will change two TextBoxes styles. For the first TextBox control, we will change its styles by using XAML properties. And for the second TextBox control, we will change its various style properties programmatically. The TextBox class FontFamily property gets or sets the font used to display text in the control. This TextBox property is inherited from Control. This property v...

UWP - Select TextBox all text when get focus

UWP - Select TextBox all text on focus The following Universal Windows Platform application development tutorial demonstrates how we can select all text of a TextBox when the specified TextBox gets focused. In this UWP tutorial, we will handle the TextBox class GotFocus event to select all text of this TextBox instance. We will use the TextBox class SelectAll() method to select TextBox all text when TextBox is focused. The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The TextBox GotFocus event occurs when the TextBox UIElement receives focus. The GotFocus event is raised asynchron...

UWP - How to create a multiline TextBox

UWP - Multiline TextBox The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The following Universal Windows Platform application development tutorial demonstrates how we can create/display a multiline TextBox. The AcceptReturns and TextWrapping properties control whether the TextBox displays text on more than one line. The TextBox class AcceptsReturn property gets or sets the value that determines whether the text box allows and displays the newline or return characters. This property value is a Boolean. The property value is true if the text box allows newline characters otherwise the value ...

UWP - How to change TextBox background color

UWP - Change TextBox background color The TextBox class represents a control that can be used to display and edit plain text. A TextBox can be single or multi-line. The TextBox control enables the UWP app user to enter text into a UWP app. The TextBox is typically used to capture a single line of text but the UWP developers can configure it to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format. The following Universal Windows Platform application development tutorial demonstrates how we can set or change the TextBox background color. Here we will wrap the TextBox control with a Border control. Then We will set the Border control’s background color. This color will be displayed as the TextBox control’s background color. We will also set the TextBox background color programmatically when it gets focused. The Border class draws a border, background, or both, around another object. The Border cl...