VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Have you ever wanted to run the same subroutine for many controls without using a contraol array? O

by Kenneth Bucci (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 2nd September 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Have you ever wanted to run the same subroutine for many controls without using a contraol array? Only a few lines of code, make special note

Rate Have you ever wanted to run the same subroutine for many controls without using a contraol array? O



'Add one button control and two text boxes to a form.
'Add the following code.

Private Sub Command1_Click()
TxtChange Text1
TxtChange Text2
End Sub

Private Sub TxtChange(Ctrl As TextBox)
    Ctrl.Text = "Got Me " + Ctrl.Name
End Sub



Download this snippet    Add to My Saved Code

Have you ever wanted to run the same subroutine for many controls without using a contraol array? O Comments

No comments have been posted about Have you ever wanted to run the same subroutine for many controls without using a contraol array? O. Why not be the first to post a comment about Have you ever wanted to run the same subroutine for many controls without using a contraol array? O.

Post your comment

Subject:
Message:
0/1000 characters