We help IT Professionals succeed at work.

vb.net - declare control in function

XK8ER
XK8ER used Ask the Experts™
on
hello,
I have two winsock in frmMain.vb and I have a function in Class1.vb

im calling from frmMain

Public Sub Get_Page(winsockNumer)
   connect(winsockNumer)
End Sub

is it possible to make Get_Page1 with winsock1 or winsock2?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015
Commented:
You could use an array and align the winsock numbers with the array index.

Public Sub Get_Page(winsockNumer)
   Dim connectors() As String = {"winsock0", "winsock1", "winsock2"}
   connect(connectors(winsockNumer))
End Sub