From fd7982c9745b06c5465563f88ba0d2ecc338b9d2 Mon Sep 17 00:00:00 2001 From: Marcus Ferl Date: Fri, 1 Apr 2022 20:57:45 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EStyleFunctions/Textbox=5FHint=5FText.c?= =?UTF-8?q?s=E2=80=9C=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StyleFunctions/Textbox_Hint_Text.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 StyleFunctions/Textbox_Hint_Text.cs diff --git a/StyleFunctions/Textbox_Hint_Text.cs b/StyleFunctions/Textbox_Hint_Text.cs new file mode 100644 index 0000000..c101ea6 --- /dev/null +++ b/StyleFunctions/Textbox_Hint_Text.cs @@ -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; + } + } + } \ No newline at end of file