Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB6 Question

Options
  • 30-03-2005 9:59am
    #1
    Closed Accounts Posts: 314 ✭✭


    Hello, :)

    Does anyone know how to create an array in VB6 at runtime?

    Rather than physicaly laying out the control array at design time I would like to map out an array of image boxes in code as I think this would be ultimatly more felxiable.

    Any tips would be helpfull


Comments

  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    There should be no shortage of samples in the online help about dynamic control creation. Have you checked there yet, and if so, is there anything specific you have a problem with?


  • Closed Accounts Posts: 314 ✭✭Jimboo_Jones


    Yeah I found them now, the key was to use the word dynamically, 'how to create objects at runtime' didn't appear to bring up anything usefull

    Set shpCell = Controls.Add("vb.shape", "shpcell")
    shpCell.Visible = True

    seems to work, just a case of setting out them in the matrix I require now

    Thanks :)


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    np. I've not-so-fond memories of struggling with the VB6 help, knowing that what I want is in there *somewhere*, but not being able to find it.

    VB5's help was, IMHO, the highpoint - the best help for VB, in the world, evarrrr. Then MS "upgraded" it alongside the language.

    jc


  • Registered Users Posts: 1,421 ✭✭✭Merrion


    If you add one instance of teh control at design time and set it's Index property to zero then you can use the Load keyword to load more instances of the control.


  • Closed Accounts Posts: 314 ✭✭Jimboo_Jones


    Cheers :D

    Load shpTest(100)
    shpTest(100).Visible = True

    as lister once said, sheeee ridesssss ;)


  • Advertisement
Advertisement