A control's default property the value you get or set when you use the control without specifying a property. Its "caption property" is immediately displayed without waiting for you to press Enter when you type in the Properties window at design time.
You set both of these properties by assigning a special procedure ID to the properties using the Procedure Attributes method. Unfortunately a property can only have one procedure ID at a time so you cannot make the same property both the "caption property" and the default property.
To work around this, create a hidden property. You can give iy ant name because the the user will never see it. Double click the control to open it. Select the Tools menu's Procedure Attributes item and click the Advanced button to show this dialog. In the Name dropdown, select the property you want to use. In the Procedure ID dropdown, select "(Default)." Check the "Hide this member" box so the property doesn't appear in the Properties window.
Now select the real property you want to use as the caption property. In the Procedure ID dropdown, select "Caption" and click OK.
Now delegate the hidden property to the property you just assigned as the caption property. The following code shows how you might delegate the HiddenDefault property to the TheCaption property.
|