I am coding a user control. Within the user control I am trying to define a callback. Here is what I have:

//class var (create delegate)
private delegate void sockDelegate(string s);

//in constuctor (init delegate variable)
frmMain fMain = new frmMain();
sockDelegate del = new sockDelegate(fMain.socketClicked);

//when the socket is clicked (button event handler). Call the callback function on frmMain
del("the socket was clicked");


The problem is in the constructor. I have to create an instance of frmMain, but it has an instance of this user control so:
frmMain loads and inits the user control which loads a frmMain which loads a user control whick loads a frmMain....etc....etc until the stack is full.

How can I assign the callback? I would like a code example of a function in the user control that will assign the callback, taking the function as a passed parameter. Something like:

public bool assignCallback(functionName, formInstance){...}

Please help me!