Enter Fuktion

Anmelden etc kann man jetzt mit enter bedienen
This commit is contained in:
BlackViron 2024-08-22 12:19:00 +02:00
parent eb97a29912
commit ce490cf68f
4 changed files with 52 additions and 7 deletions

View File

@ -101,7 +101,7 @@
Margin="0,30,0,0"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="usernbox_KeyDown"/>
<!-- Benutzername TextBox -->
<TextBlock Text="Passwort"

View File

@ -70,6 +70,13 @@ namespace bib_talk
register.Show();
this.Close();
}
private void usernbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
passwordbox.Focus();
}
}
private void passwordbox_KeyDown(object sender, KeyEventArgs e)
{

View File

@ -142,7 +142,7 @@
Margin="0,30,0,0"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="emailbox_KeyDown"/>
<!-- Benutzername TextBox -->
<TextBlock Text="Benutzername"
@ -157,7 +157,7 @@
Margin="0,30,0,0"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="usernbox_KeyDown"/>
<!-- Passwort PasswordBox -->
<TextBlock Text="Passwort"
@ -172,7 +172,7 @@
Margin="0,30,0,0"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="passwordbox_KeyDown"/>
<!-- Geburtsdatum Text -->
<TextBlock Text="Geburtsdatum"
@ -187,7 +187,7 @@
BorderBrush="Transparent"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="bday1_KeyDown"/>
<TextBox Width="100"
Height="30"
FontSize="20"
@ -195,7 +195,7 @@
BorderBrush="Transparent"
Background="#FF323134"
Foreground="White"
SelectionBrush="#FF6332A0"/>
SelectionBrush="#FF6332A0" KeyDown="bday2_KeyDown"/>
<TextBox Width="100"
Height="30"
FontSize="20"

View File

@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Navigation;
@ -120,7 +121,44 @@ namespace bib_talk
return true;
}
private void emailbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
usernbox.Focus();
}
}
private void usernbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
passwordbox.Focus();
}
}
private void passwordbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
bday1.Focus();
}
}
private void bday1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
bday2.Focus();
}
}
}
private void bday2_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
bday3.Focus();
}
}
}
}