I'm in needing of help of using controls from another form. Here is what I want to use it in:
if (form2.checkbox1.IsChecked)
{
messagebox.Show("Form2 Checkbox1 is selected!");
}
But it doesn't show the controls on form2 when I type:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Form2.
}
Any help will be greatly appreciated! :)
VulpesPosted Oct 7, 2013, 6:39 AM
Form2 f2 = (Form2)Application.Current.Windows[1];
CheckBox cb = f2.checkbox1;
purushothaman vPosted Oct 7, 2013, 6:02 AM
Form2 frm2=new Form2();
You will get the controls from "frm2".