VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Default functions and properties

by Jon Davis (4 Submissions)
Category: Coding Standards
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

Make a function or a property the default function or property for that object.

Rate Default functions and properties

It's easy to set specific procedures as default. For instance, if you have a custom collection object and you wish to make the "Item" procedure the default procedure so that "Item" does not have to be referenced (e.g. "MyCollection(key)" rather than "MyCollection.Item(key)"), it can be done. It's really very simple!


To make a function or a property the default function or property for that object, simply open up the object browser, locate the procedure by name, right-click on the procedure name, choose "Properties", expand the "Advanced >>" settings, and rename the Procedure ID to "(Default)".


See the screenshot for a demonstration.

Download this snippet    Add to My Saved Code

Default functions and properties Comments

No comments have been posted about Default functions and properties. Why not be the first to post a comment about Default functions and properties.

Post your comment

Subject:
Message:
0/1000 characters