private void button1_Click(object sender, EventArgs e) { AddPatient(); ErrorProvider.ReferenceEquals(textBox5, ""); if (videoSource != null) { videoSource.SignalToStop(); videoSource.WaitForStop(); } }