Results 1 to 8 of 8

Thread: 2D Control Array??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    27

    Question 2D Control Array??

    I know that it is possible to have a 2 dimensional array by just going

    Dim arr(2, 3) as Integer

    my question is:
    Is it possible to have a 2 dimensional control array?? If so how do you dim it sunce the index number is a single number not 2, 3 or something like that.

    Thanks for any advice

  2. #2
    DaoK
    Guest
    Is it possible to have a 2 dimensional control array??
    Like a textbox1(2,3).text ?

  3. #3
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    Look at the second to last post here:
    http://vbforums.com/showthread.php?t...ltidimensional
    You just cant do withevents with it.
    retired member. Thanks for everything

  4. #4
    Basically, you can't. You can make a 1D array and make a 2D wrapper, however.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    27
    Thanks very much for you input... Now the only problem that im having is that im trying to have it so that the labels that compose my control array are loaded and removed when i use 2 vertical scroll bars, one for horizontal and one for vertical.So if my scroll bars are set at 7 and 7 the control aray of ladels will be made up of 49 of them.

    thanks again

  6. #6
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448
    To my knowledge it's not possible, because the INDEX property of each control is the associated value. The problem with multidimensional arrays in what you're talking about is the multiplying effect.

    (5, 3)

    [] = memory cells

    [control()] [] []
    [control()] [] []
    [control()] [] []
    [control()] [] []
    [control()] [] []

    The other 10 memory cells would have to be controls. There really wouldn't be any point to doing this, because it would complicate it. If you want to achieve the effect you want, try using to different control arrays and making their indexes match up for easy referencing, and use for loops.

    Text(0) and Label(0)
    Text(1) and Label(1)
    Text(2) and Label(2)
    etc.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    27
    Thanks but do you think that you could give me some advice on how to duplicate this program....(See attachment) This is what i am trying to do, I have everything working but the loop that loads and unloads the labels inside the frame.


    As you can see it adds more labels into the array both horizontally and vertically while keeping the color in the preexisting boxes.

    Im really confused as to how to accomplish this.
    Attached Files Attached Files

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    27

    Unhappy Please

    Please can anyone help me, this project is due tomorrow and my teacher is a nob. He offeres no help hints or ideas and i cant find this info in any book (not even my text book) or on the web. If anyone even knows a good website that might have this info on it could you please tell me.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width