How can i access to a textbox in MainWindow from another form, without
creating an instace of it in a WPF?
private void btnConfirmInMyForm_Click(object sender, RoutedEventArgs e)
{
//for example without creating like this
MainWindow mainWin = new MainWindow();
mainWin.txtBirthDate.Text = "anything";
this.close();
}
when i try the above, content of the txtBirthDate of new instance of
MainWindow (mianWin) changes to "anything", but not in current MainWindow!
in other words as i click btnConfirmInMyForm in MyForm it opens a new
MainWindow with the txtBirthDate textBox contains "anything", which i
don't want! i only want to set the txtBirthDate from MyForm, not to create
a new MainWindow that contains this!
with best regards
No comments:
Post a Comment