HOWTO: Create a Default Property For a User Control

Last reviewed: March 21, 1997
Article ID: Q161208
The information in this article applies to:
  • Microsoft Visual Basic Control Creation Edition for Windows, version 5.0
  • Microsoft Visual Basic Enterprise Edition for Windows, version 5.0

SUMMARY

You can create a default property for your User Control. A default property is the property selected when you select the control in Design Mode. For example, when you select a Label, the highlighted property is Caption. Therefore, Caption is the default property for the Label. This article will explain how to create a default property for a User Control that you create.

MORE INFORMATION

After the property is created, follow these steps to make the property the default property:

  1. From the Tools menu, select "Procedure Attributes."

  2. In the "Procedure Attributes" dialog box, select the property name you previously created.

  3. Add a Description, if desired, and select the "Advanced>>" button.

  4. Select the "User Interface Default" checkbox in the Attributes frame.

When using the User Control in designing a Visual Basic form, the default property will be highlighted when the User Control is selected.

You can only have one default Property for each Control. Therefore, you can only select the "User Interface Default" checkbox for one property. If you select this checkbox for another property, it will ask you if you want to make the newly-selected property the Default property.

REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q161156
   TITLE     : How to Create a Default Event for a UserControl
 

	
	


Keywords : kbusage vb5all vb5howto VBKBCtrl_VBKBStd kbhowto
Version : 5.0
Platform : WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.