Click here to Skip to main content
15,308,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to pass multipul parameres in vb.net function.

I have function called EnableControls as below.

VB
Function EnableControls(ByVal ctl as control)
       ' "ByVal ctl as control" should accept multiple entries OR values
       ' Execute loop which accept all controls in ctl parameter
       ' For e.g. (Loop is tentative I need solution for loop as well)
       For i = 0 to ctl.length
            'Execute loop here (I need loop solution)
             'i.e. ctl[X control].Enabled = True
       Next

End Function


Function will called here

VB
EnableControls ('Here I want to pass as many as controls e.i. txtname,txtaddress,txtphoneno etc,btnaddrecoed)
Posted

1 solution

Try:
VB
Function EnableControls (ParamArray controls() As Control)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900