The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 3.0
SUMMARY
This article describes how to add properties or methods to buttons in a
command-button group
MORE INFORMATION
Neither properties nor methods can be added directly to buttons in a
command-button group. This is by design. Properties or methods added to a
button in a command-button group appear as part of the command-button group
object, not part of the button itself.
To add properties or methods to a button in a command-button group, you
must:
- Subclass the command button in the Class Designer.
- Add the property or method there.
- Create a container class.
- Add the new button class to the new container.
Steps to Add a Property or Method to a Command Button
- From the file menu, choose New. Select Class as the file type, and click
New File.
- Type in a class name for this new class, select CommandButton from the
Based on menu, and enter a .VCX file name to store the class in. You can
use one that already exists or enter a new .VCX file name for Visual
FoxPro to create.
- When the Visual Class Designer window appears, choose New Property from
the Class menu. Enter a name for this new property in the name text box
of the New Property dialog box. Click the OK button, and scroll through
the property sheet for this class. Notice that your new property appears
at the bottom of the list. This property defaults to value of false
(.F.).
- Close and save the changes to this new class.
- Create another new class (see step 1) based on a container.
- Click the View Classes button of the Form Controls toolbar. Select Add,
and choose the .VCX file you just created. From this file, select the
class you created if prompted.
- Click the commandbutton button on this new toolbar. Then click the
container window in the Visual Class Designer. This adds a command
button to the container that has the property you added by subclassing
the commandbutton class in step 2 above.
|