http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/CustomLoginForms_04.jpg
I want to ask, how do you blur a text inside the textbox? i want to put the "insert your username" and "insert your password" into them.
i want to create a new project without using a label to label the textbox for username and password. and here is an example. click the link above.
thanks.
Sujeet SumanPosted Oct 23, 2015, 3:03 PM
Vaibhav DeshmukhPosted Oct 23, 2015, 7:35 AM
private void txt1_GotFocus(object sender, RoutedEventArgs e)
{
TextBox t = sender as TextBox;
data = t.Text;
t.Text = string.Empty;
}
private void txt1_LostFocus(object sender, RoutedEventArgs e)
{
TextBox t = sender as TextBox;
if (t.Text.Equals(string.Empty))
{
t.Text = data;
}
}
string data1;
private void txt2_GotFocus(object sender, RoutedEventArgs e)
{
TextBox t = sender as TextBox;
data1 = t.Text;
t.Text = string.Empty;
}
private void txt2_LostFocus(object sender, RoutedEventArgs e)
{
TextBox t = sender as TextBox;
if (t.Text.Equals(string.Empty))
{
t.Text = data1;
}
}