//Add the Form parameter in the constructor, so this control can get the ID public formLayout(communicationForm parentForm) { InitializeComponent(); this.parentForm = parentForm; this.sendButton = sendMessageButton; }
//Constructor of the communication with known receiver form public communicationForm(communicationForm receiverForm) { InitializeComponent(); this.receiverForm = receiverForm; layout = new formLayout(this); layout.Dock = DockStyle.Fill; this.Controls.Add(layout); this.AcceptButton = layout.sendButton; }