$0'Note the namespace and class names. Just create two textboxes on called txtLogin and the other txtPassword$0
$0'Make sure you make the default textbox foreground color lightgray.$0
$0$0
$0
$0Imports System.Windows$0
$0Imports System.Windows.Controls$0
$0Imports System.Windows.Media$0
$0$0
$0
$0Namespace LoginNS$0
$0Partial Public Class Login$0
$0 'Make sure you make the default textbox foreground color lightgray.$0
$0 Public Sub New()$0
$0 InitializeComponent()$0
$0 AddHandler txtLogin.GotFocus, AddressOf LoginIsFocused$0
$0 AddHandler txtLogin.LostFocus, AddressOf LoginNotFocused$0
$0 AddHandler txtPassword.GotFocus, AddressOf PasswordIsFocused$0
$0 AddHandler txtPassword.LostFocus, AddressOf PasswordNotFocused$0
$0 End Sub$0
$0 Private Sub LoginIsFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0
$0 IsFocusedProps(txtLogin, "Enter a Login")$0
$0 End Sub$0
$0 Private Sub LoginNotFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0
$0 NotFocusedProps(txtLogin, "Enter a Login")$0
$0 End Sub$0
$0 Private Sub PasswordIsFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0
$0 IsFocusedProps(txtPassword, "Enter a Password")$0
$0 End Sub$0
$0 Private Sub PasswordNotFocused(ByVal sender As System.Object, ByVal e As RoutedEventArgs)$0
$0 NotFocusedProps(txtPassword, "Enter a Password")$0
$0 End Sub$0
$0 Private Sub IsFocusedProps(ByVal focusedtxtbox As TextBox, ByVal txtboxtext As String)$0
$0 If focusedtxtbox.Text <> txtboxtext Then$0
$0 Exit Sub$0
$0 End If$0
$0 focusedtxtbox.Text = ""$0
$0 focusedtxtbox.Foreground = New SolidColorBrush(Colors.Black)$0
$0 End Sub$0
$0 Private Sub NotFocusedProps(ByVal focusedtxtbox As TextBox, ByVal txtboxtext As String)$0
$0 If focusedtxtbox.Text <> "" And focusedtxtbox.Text <> txtboxtext Then$0
$0 Exit Sub$0
$0 End If$0
$0 focusedtxtbox.Text = txtboxtext$0
$0 focusedtxtbox.Foreground = New SolidColorBrush(Colors.LightGray)$0
$0 End Sub$0
$0End Class$0
$0End Namespace$0