HOWTO: Create a Default Value for Custom Controls and ClassesLast reviewed: March 18, 1997Article ID: Q161052 |
The information in this article applies to:
SUMMARYMicrosoft Visual Basic 5.0 allows you to create custom controls and Classes that have a default property. This behavior is similar to the intrinsic TextBox control. The TextBox control has a default value that corresponds to the string value of its Text property. This allows the following code to behave identically:
MsgBox Text1.Text -and- MsgBox Text1Both will display a dialog box containing the Text shown within the TextBox.
MORE INFORMATIONTo set an existing property as the default value for a custom control or Class, do the following:
Msgbox UserControl1.MyProperty -and- Msgbox UserControl1are equivalent statements.
REFERENCESMicrosoft Visual Basic version 5.0 Books Online Component Tools Guide. "General Principles of Component Design" |
Keywords : kbusage vb5all vb5howto VBKBCtrl kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |