for your code to work, 'frmclose needs to have a valid
reference to the instance of 'frmDBVerify you wish to close:
private frmDBVerify frmclose;
private void Form1_Load(object sender, EventArgs e)
{
frmclose = new FrmDBVerify();
frmclose.Show();
}
private void Test() {
if (frmclose == null) throw new NullReferenceException();
this.frmclose.Close();
}
Note that calling 'Close on an instance of a Form that has been
created using 'new, but
not 'Shown, will not throw an error.