counting

joycekev
09-19-2002, 06:47 AM
sorry to bother one and all again by displaying my lack of ability in vb but was hoping that the kind souls who have helped me again could provide the service once again.

I have a setup that looks like this (more or less):


X1 X2

Y1 Y2

GO!

The X and Y's represent butons as does the GO!. What i'm hoping (yet dismally failing) to achieve is that when a single X or Y is visible it has a value of 1 and 0 when it is not visible. Cicking on a X or Y makes it not visible. The notion being that I could have a formula say 'If X1+X2 = Y1 + Y2 then' eg total up the number of X's visible and Y's possible and make a comparrison between the total numbers. This statement would be activated by clicking the GO! button.

I think that makes sense - i've been playing with Const to no avail, but at any point in my life will happily admit to being a muppet so this may be not seeing the wood for the trees.

thanks for any help

kev

Iceplug
09-19-2002, 06:55 AM
You can test a button's.Visible property to see if it is visible.

If ButtonX1.Visible Then X1 = 1 Else X1 = 0
If ButtonX2.Visible Then X2 = 1 Else X2 = 0

In addition, you can probably use
X1 = Abs(ButtonX1.Visible),
but is more advanced.

joycekev
09-19-2002, 07:28 AM
i'm a fool thanks for the help

will i be able to add up the values in a seperate if statement or do i need to link it somehow?

Iceplug
09-19-2002, 08:44 AM
You can add up the values for the buttons in your "GO" click subroutine before you do your calculation.

joycekev
09-19-2002, 11:10 AM
thanks , appreciate the help

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum