How to Close() the MDIChild -during its Form_Load()

Paraman

Member
Joined
Oct 19, 2024
Messages
12
Programming Experience
10+
Hi, I wish to close the MDI-Child Form during its Form_load(). Is it possible?

My Codes

C#:
private void Form_BooksMaster_Load(object sender, EventArgs e)
{
    if (MyDBConnector == false) {
        this.Parent = null;
        //this.Close();  ?? Error : Value Close() cannot be called while doing CreateHandle()
        //this.BeginInvoke(new MethodInvoker(this.Close)); ?? Error C3867 'System.Windows.Forms.Form.Close': non-standard syntax; use '&' to create a pointer to member
        return;   
    }
}
Thanks Again !
 
Back
Top Bottom