Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

VB6 Question

  • 30-03-2005 09: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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 1,430 ✭✭✭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