Buttons, ButtonCount
Let me take you a button-hole lower.
William Shakespeare, Love's Labour's Lost
These properties tell you about the buttons in a button group, whether they're option buttons or command buttons. ButtonCount tells you how many are in the group, while Buttons gives you access to the PEMs of the individual buttons.| Usage | oObject.ButtonCount = nNumberOfButtons nNumberOfButtons = oObject.ButtonCount oButton = oObject.Buttons( nButtonNumber ) |
| Example | * Look for the button whose caption is "My Favorite Button" * Assume we're in a method of the button group LOCAL nButton, lFoundIt nButton = 1 lFoundIt = .F. DO WHILE nButton <= This.ButtonCount AND NOT lFoundIt IF This.Buttons[nButton].Caption = "My Favorite Button" lFoundIt = .T. ELSE nButton = nButton + 1 ENDIF ENDDO IF lFoundIt WAIT WINDOW "My Favorite Button is "+LTRIM(STR(nButton)) ELSE WAIT WINDOW "My Favorite Button is missing" ENDIF |
| See Also | ControlCount, Controls, SetAll |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.