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: Intermediate
Aug 20, 1997

Use the Controls Collection

If you need to reference every control on a form, using the Controls collection will be faster than referencing every control directly. For example, if you have four command buttons on a form and you want to set the Enabled property to False for all of them, you have two options.
Option 1:
 cmdAdd.Enabled = False 
cmdEdit.Enabled = False 
cmdDelete.Enabled = False 
cmdNext.Enabled = False 

Option 2 will execute approximately 10 to 15 percent faster than Option 1:
 For iLoop = 0 To 3 
Controls(iLoop).Enabled = False 
Next 
Paul D. Sheriff
 
Comment and Contribute

 

 

 

 

 


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

 

 

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