There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
[SOLVED] VB 6 control array


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
lamstaldy's Avatar
Senior Member with 113 posts.
 
Join Date: Dec 2001
Location: Plymouth, Mass.
16-Oct-2003, 04:05 PM #1
VB 6 control array
Is it possible to create a two dimensional control array? I have a grid of command buttons (four across and eight down) that I would like to make into a two dimensional array.
AbvAvgUser's Avatar
Distinguished Member with 2,313 posts.
 
Join Date: Oct 2002
Location: Mumbai, India
Experience: Intermediate
17-Oct-2003, 01:46 AM #2
I think it is not possible. All the documentation says object(index) and not object(index1, index2).

But as they say, nothing is impossible. You may be able to find out some indirect workaround somehow. Will have to think hard to be able to do this. But is it worth the effort? You are best judge of how frequently you want to use it.
__________________
Domains, web hosting, websites
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
17-Oct-2003, 09:42 AM #3
The only workaround I know of is to write a function to get the object from a single dimension array, by translating 2d coordinates.

Ie, if you KNOW your width is always four, write a function as follows.

Code:
Private Function getCommand(byval X as integer, Byval Y as Integer) as Command
  Set getCommand = CommandArray((y-1) * 4 + x)
End function
Then use that function to get your command object from the array, rather than the array directly.
__________________
izme: You know...it's kind of nice to sit atop Civilized debate and look down below on all of the uncivilized master debating we are here...just out of the fight zone

Gibble: Now you know what it's like to be Canadian.
lamstaldy's Avatar
Senior Member with 113 posts.
 
Join Date: Dec 2001
Location: Plymouth, Mass.
17-Oct-2003, 01:03 PM #4
Thanks for the help. I too could only find info on single dimension control arrays, but I figured it couldn't hurt to ask. I think I'll just create 8 individual control arrays and then pass them to a sub routine as I need them. Nested For loops would have made life easier, but what are you gonna do? Thanks again for the input.
__________________
Once in awhile you get shown the light in the strangest of places when you look at it right. Robert Hunter.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:03 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.