Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

 

Under UWP Universal Windows Platform applications, the _TextChanged event always fires whenever the textbox or input fields change.

In Windows desktop applications, this was only possible after completion of the entire input with Enter or Tabulator.

 

Task:

How can I recognize text changes in UWP using the Enter key?

 

Solution:

For this one must install the KeyDown event and examine this after the Enter key

 

Text box Enter with Enter key or Enter key

private async  void tbxFolder_KeyDown(object sender, KeyRoutedEventArgs e)

{

    if (e.Key == Windows.System.VirtualKey.Enter )

    {

await clsSys.show_Message("TextChanged changed by enter");

    }

}

 

 

Wrong: Here the text changes as soon as you enter a letter.

private async  void tbxFolder_TextChanged(object sender, TextChangedEventArgs e)

{

    await clsSys.show_Message("tbxFolder_TextChanged");

    //fp_set_storageFolder_by_Text();

    //fp_load();

}

 

private async  void tbxFolder_TextChanging(TextBox sender, TextBoxTextChangingEventArgs args)

{

    await clsSys.show_Message("tbxFolder_TextChanged");

}

 

 

In XAML, include the KeyDown event in the control

<TextBox x:Name="tbxFolder" Grid.Column="1"   VerticalAlignment="Center"  VerticalContentAlignment="Center" KeyDown="tbxFolder_KeyDown"

                     ></TextBox>


 
 
Text tutorial
https://www.youtube.com/watch?v=LKTSYidTUzI&feature=youtu.be
 

Mobile
»
UWP: Textchanged with Enter Enter

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de