Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Apr 14, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Sub Procedures or Functions in Visual Basic

Is it possible to have subprocedures or subfunctions in Visual Basic? For example, in COM components we find properties being accessed using the following:
myObject.Column("myColumn").Hide = True
In this Column is a function with a hide property. Is it possible in Visual Basic to write such functions, and if it is possible, how to write them

Yes it is possible. It is accomplished by having a property return an object as its value. So using your example the Column property of MyObject actually returns a Column object, allowing the client of the object to get the object and set one of its properties in one line of code.

What we are discussing here is creating an object model in which the top level object is used to access its child objects.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date