In my WPF application I've a textbox that holds a date.
I want that after the user enter the day a "/" will be added, and the same after the month...
this is my code:
private void DateTextBox_KeyDown(object sender, KeyEventArgs e)
TextBox tb = e.Source as TextBox;
string temp = tb.Text.Trim();
int len = temp.Length;
if (e.Key == Key.Back)
string new_line = "";
for (int i = 0; i < len - 1; i++)
new_line = new_line + temp[i].ToString();
View Complete Post