I have the doubt of how to put the text that is entered in a textbox in another window.
Explaining this:
The user will login in a window, at the time of entering a splash will open welcoming, what I want to do is to appear the username you entered in the splash welcoming.
My code is as follows:
Login window
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void BtnIngreso_Click(object sender, RoutedEventArgs e)
{
//Validacion de usuario y contraseña
if (txtuser.Text == "User" && txtpass.Password == "1234")
{
//Si el usuario es correcto, llamar al splash
SplashBienvenida splashBienvenida = new SplashBienvenida();
splashBienvenida.LUser = txtuser;
splashBienvenida.Activate();
splashBienvenida.Show();
this.Close();
}
else
{
//Mostrar el mensaje en caso erróneo
MessageBox.Show("Usuario o contraseña no validos");
}
}
Splash Window
public partial class SplashBienvenida : Window
{
DispatcherTimer dT = new DispatcherTimer();
public SplashBienvenida()
{
InitializeComponent();
//Inicia el conteo que durara la ventana de Bienvenida
dT.Tick += new EventHandler(dT_Tick);
dT.Interval = new TimeSpan(0,0,10);
dT.Start();
}
//Al momento que termine el conteo mandara llamar la ventana siguiente
public void dT_Tick(object sender, EventArgs e)
{
Opciones opciones = new Opciones();
opciones.Show();
dT.Stop();
this.Close();
}
}