I have a form (AddNewCamper), which contains a textbox and a submit button. In a different form, I'm trying to write:
if (submit button is clicked)
do stuff
In the window that the button is actually in, I have a click event created. So I guess I'm trying to call that click event inside the if statement (which is in a different window from where the click event is located).
Here's what I have:
AddNewCamper camp = new AddNewCamper();
camp.Show();
// This is where I'm confused. How do I say if this button is clicked,
// or how do i call its click event that's located in AddNewCamper?
if (camp.btnNewSubmit_Click_1())
{
Camper person = new Camper(camp.txtNewFirstName.Text);
camp.txtNewFirstName.Text = person.getName();
c.testListBox.Items.Add(person.getName());
campersFrame.Content = c;
}
AddNewCamper.btnNewSubmit_Click_1()directly, is that all?AddNewCamper.btnNewSubmit_Click_1()event handler inAddNewCamper?