C# Checking if button was clicked
I am making a Program, that just should continue, if 2 conditions are given. The first one 2 TextBoxes have the same word in and a Button was clicked, which opens a new Form. You see i am trying to make a registration Form ;) Now i have the event for the "complete" button. private void button2_Click(object sender, EventArgs e) { if (textBox2.Text == textBox3.Text && ???) { StreamWriter myWriter = File.CreateText(@"c:\Program Files\text.txt"); myWriter.WriteLine(textBox1.Text); myWriter.WriteLine(textBox2.Text); My problem is, i cant find a method, that gives something like button1.Clicked or