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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VB6 Question

  • 30-03-2005 8: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,423 ✭✭✭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