I was able to solve this by implementing an interface to the container form:
Code:// Include this interface in your container form: public interface ICallBack { void callBack(string socket); } // Then have your container form inherit the interface: // public class frmMain : System.Windows.Forms.Form , ICallBack { ... } // Now since you are using an interface, you must include the function "callBack" in your container form. public void callBack(string socket) { Console.WriteLine(socket); } // Now in your event handler on the control: private void sockClickHand(Object sender, System.EventArgs e) { ICallBack cb = this.Parent as ICallBack; if(cb!=null) cb.callBack(sender.ToString()); }




Reply With Quote