Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitlePass a control array to a subroutine as a parameter
Keywordscontrol array, parameter, argument
CategoriesControls, Software Engineering
 
Receive the control array parameter as a Variant array data type. Use LBound and UBound to get its bounds, or use For Each to loop over its elements.
 
Private Sub CopyText(ByVal txt As String, dest As Variant)
Dim text_box As TextBox

    For Each text_box In dest
        text_box.Text = txt
    Next
End Sub
 
In the main program, simply pass the name of the array without parentheses or an index.
 
Private Sub cmdCopy_Click()
    CopyText txtSource.Text, txtDestination
End Sub
 
 
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated