Array Of Forms

Discussion in 'C#' started by snehil_khanor, Aug 28, 2010.

  1. snehil_khanor

    snehil_khanor New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey,
    Can any one help me with this problem.. i'ld really appreciate ne help..
    wat i wanna do is.. dat i want to dynamically create objects on a way that they could be created in a loop..
    so i thot an array of object could help
    so i went ahead and wrote this code in a form load event..
    Form1[] formarray = new Form1[4];
    for (int i = 0; i < 4; i++)
    {
    formarray = new Form1();
    formarray.Show();
    }

    but at the line

    formarray.Show();
    I get this exception
    Quote:
    Error creating window handle.
    As u mite have guessed from the code.. wat i wanna do is to open 'n' no. of forms while loading.. and n will differ every time .. actually it will depend upon the no of records in some table and i want the no. of forms to be equal to the no. of records.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice