?
Solved

VB6 checkbox(5) recursive calls

Posted on 2006-10-20
2
Medium Priority
?
264 Views
Last Modified: 2013-12-25
Hi:
I am working with VB6 and a checkbox array with 6 elements. The functionality I need is this:
When  user ckicks on checkbox(3) I want checkbox(4) and checkbox(5) = CHECKED
and
checkbox(0)checkbox(1)checkbox(2)=Unchecked.

When I wrote the code it was the chckbox_Click event gets into recursive events.
How can I accomplish the above results. Simple question please help me with sample code.
dhamijap
0
Comment
Question by:dhamijap
[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 Comments
 
LVL 20

Accepted Solution

by:
hes earned 200 total points
ID: 17775001
Try this:

Private Sub chckbox_Click(Index As Integer)
   Static bBusy As Boolean ' to stop recurrision
   Dim iCnt As Integer
   Dim iIndex As Integer
   If bBusy Then
      Exit Sub
   End If

   iIndex = Index
   For iCnt = iIndex To chckbox.UBound Step 1
      bBusy = True
      chckbox(iCnt).Value = 1
      bBusy = False
   Next iCnt

   For iCnt = iIndex - 1 To chckbox.lBound Step -1
      bBusy = True
      chckbox(iCnt).Value = 0
      bBusy = False
   Next iCnt
End Sub
0
 

Author Comment

by:dhamijap
ID: 17775062
hes:
works perfect. Thanks.
dhamijap
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 Month11 days, 12 hours left to enroll

752 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