Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Sub Procedures or Functions in Visual Basic

Question:
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

Answer:
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.

 

 

Sitemap