>Matt,
>
>I have my container shuffleing the controls. Now the container is a 4 x 4 and has 15 controls in it which leaves a space empty. I am tring to get the code right that will move a control into the empty space when clicked only if the button is adjacent to the empty space. I am having trouble testing for a button residing to the left, top, bottom, right of a clicked button.
Steven,
You have to think outside the box. He's my stab.. but don't forget, there are dozens of ways to skin a cat..
Each position for a button should have an address: 1 through 16. Create a validation lookup table:
Btn_Address N(2), Valid_near N(2)
1,2
1,5
2,1
2,3
2,6
3,2
3,7
etc.....
Each button should have a position property. (HINT: create a new button class) Each time a button gets moved, the position property should be updated. Prior to moving a button, valididate the destination by doing a seek:
SELECT Add_Valid
SET ORDER TO Adr_Validate
lnCurrent = 5
lnTarget = 6
IF SEEK(lnCurrent*100+lnTarget)
ENDIF
HTH
I try to stay online, to get better information.
I try to get away from the office once in a while..
But they KEEP... PULLING.. ME.. BACK.. IN!!!