How To Create a Default Value for Custom Controls and Classes (161052)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q161052 SUMMARY
Microsoft Visual Basic 5.0 and 6.0 allow 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 Text1
Both will display a dialog box containing the Text shown within the
TextBox.
REFERENCES
Microsoft Visual Basic version 5.0 Books Online
Component Tools Guide. "General Principles of Component Design"
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto kbusage KB161052 |
---|
|