You should probably be using a more modern Socket control, which can do everything a WinSock can, just differently.
However, if you must use WinSock, and you have added WinSock controls to your toolbox, then it's not complex.
Start by looking at what VS does for you to add a Winsock.
1) Drag one onto your form. It will be called
axWinsock1
2) Go to your code view, and in any method use the variable: just type it's name.
3) Right click it, and select "Go to definition".
4) You will be looking at the Designer file, at the line:
private AxMSWinsockLib.AxWinsock axWinsock1;
DO NOT MAKE ANY CHANGES TO THIS FILE.
5) Right click
axWinsock1
again, and select "Find all references"
You will get a new symbol results pane showing you exactly what code is needed to create an instance.
All you have to do now is duplicate that code in your own file, but using an array of controls instead:
private AxMSWinsockLib.AxWinsock[] mySockets = new AxMSWinsockLib.AxWinsock[20];
...
for (int i = 0; i < 20; i++)
{
mySockets[i] = new AxMSWinsockLib.AxWinsock();
((System.ComponentModel.ISupportInitialize)(this.axWinsock1)).BeginInit();
mySockets[i].Enabled = true;
...
}
Or at least, that's the theory - I've not tried, but it should work fine!