I'm brand new to Visual Basic (this is the first program i've tried to write) and am trying to understand how to use control arrays:
I have several series of command buttons set up as arrays:
btn1(0) btn2(0) btn3(0) btn4(0)
btn1(1) btn2(1) btn3(1) btn4(1)
btn1(2) btn2(2) btn3(2) btn4(2)
and want to be able to change the caption of the buttons by using 2 variables ([var#1] and [var#2] for the purposes of this explanation) but can only specify the button i'm referring to according to one variable (the index) and consequently am writing:
if [var#1] = "1" then btn1([var#2]).caption = [login to view URL]
if [var#1] = "2" then btn2([var#2]).caption = [login to view URL]
if [var#1] = "3" then btn3([var#2]).caption = [login to view URL]
if [var#1] = "4" then btn4([var#2]).caption = [login to view URL]
Please can someone explain to me how i can abbreviate this whole process (in Visual Basic 6), either by including a second variable in the reference to the command button's name or by allowing 2 variables in the index brackets.
I hope this makes sense! Thank you!
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Visual Basic 6 in Windows 95 - XP