Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Control Array and For...Next Loop

Posted on 1998-08-05
3
Medium Priority
?
153 Views
Last Modified: 2010-05-03
I am taking a class that has requested us to create a checker board.  I am having problems with clearing the board
and starting again.  I have a group array of labels for the checker squares.  I need to clear the BackColor from Blue to
white (vbwhite?), as well as set the focus to the TextBox control for the start value.  Here is my sample.  I can clear
the text boxes, but can not clear the labels and reset the program.  I am only clearing one of the 15 checkboxes (and I made sure that the label array was set up correctly)

Private Sub Command1_Click()
'clear input amount and outputs
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label1(Intex).BackColor = vbWhite


0
Comment
Question by:luna
  • 2
3 Comments
 

Author Comment

by:luna
ID: 1468066
Edited text of question
0
 

Accepted Solution

by:
zabman earned 100 total points
ID: 1468067
Use a FOR...NEXT LOOP!

Try the following:

Private Sub Command1_Click()
'clear input amount and outputs
Text1.Text = "" 
Text2.Text = "" 
Text3.Text = "" 

For Count = Min to Max              'where Min is the smallest,
  Label1(Count).BackColor = vbWhite 'and Max is the largest
Next Count                          'number in the array!

Hope this will not be considered cheating!

                            -- Neil Z. :-)

Send me a copy when your done, i'd like to see it!
0
 

Author Comment

by:luna
ID: 1468068
I will try it and let you know!  I don't consider it cheeting.  I have @ 3 projects that I was having problems with and the teacher is NO help at all.  I have been racking my brain for days...  I appreciate all of your help!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question