Solved

Control Array and For...Next Loop

Posted on 1998-08-05
3
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:luna
ID: 1468066
Edited text of question
0
 

Accepted Solution

by:
zabman earned 50 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 123
vb6 connector to mongodb 2 143
using web browser with BING 40 136
how to know if my Checkbox is True in VB6.0? 9 66
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 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