„StyleFunctions/Textbox_Hint_Text.cs“ hinzufügen

This commit is contained in:
Marcus Ferl 2022-04-01 20:57:45 +02:00
parent eb429dadfe
commit fd7982c974

View File

@ -0,0 +1,18 @@
class Textbox_Hint_Text
{
TextBox textboxs = new TextBox();
private void textbox_MouseEnter(object sender, MouseEventArgs e)
{
textboxs.Text = "";
textboxs.Foreground = Brushes.White;
}
private void textbox_MouseLeave(object sender, MouseEventArgs e)
{
if (textboxs.Text.Length == 0)
{
textboxs.Text = "Search";
textboxs.Foreground = Brushes.Gray;
}
}
}