OriginalGriff's answer, and SAK's eloquent critique of System.ComponentModel, are a feast for the intellect, and may well give you all the tools you need to achieve your solution.
But, I'm going to go, recklessly, 'out on a limb' here, and suggest a very different approach to this.
And, you'll forgive me, I hope, if I do this via Socratic method ... an 'experiment' for me, as well as you, perhaps ... since it would be interesting to me to know if what (I hope) I am implying by experimentation "resonates" with you.
Let me just ask to you do a simple experiment:
1. create a WinForms project, add a UserControl template to the project, insert one TextBox into the UserControl template, 'textBox1.' Leave the Text of textBox1 'blank.'
2. in the Load event of that UserControl put this one line of code:
textBox1.Text = "uc loaded";
3. Build the project.
4. at design-time drag-drop an instance of the compiled UserControl onto the surface of the Form.
5. observe what appears in textBox1 of the UserControl.
6. delete the design-time placed UserControl from the Form.
7. put a button on the Form and set its click handler to:
private void button1_Click(object sender, EventArgs e)
{
UserControl1 uc1 = new UserControl1();
this.Controls.Add(uc1);
}
8. once again observe what appears in the textBox1 of the UserControl.
9. Now: alter the code in the UserControl's Load event:
textBox1.Text = "uc loaded : " + this.Parent.Name;
10. Now once again build the Project and drag-drop an instance of the UserControl onto the Form surface: observe what's in textBox1.
11. Now delete the drag-dropped UserControl from the Form and run the project, and click on button1 in the Form that creates a new UserControl in code:
12. Observe the contents of textBox1 in the UserControl
Discussion:
0. note that the experiment described above does NOT require a reference to System.ComponentModel for either Form or UserControl.
1. why use a cannon to shoot a horse-fly ? i.e., why get involved with Attributes and System.ComponentModel ... if there's a simpler way ?
2. You now know (I hope) that whether a UserControl is drag-dropped on a Form at design-time, or created at run-time, its Load event is fired, and ... in that Load event ... access is available to the object (in this case a Form) that is creating it.
3. I'll assume that the technique required to publish/expose some method or whatever on a Form ... so it's available from an instance of the Form from outside the scope of the Form definition ... is obvious to you.
I'd be very interested to know if what is suggested here seems like a basis for a solution to the question you ask. And, I'm ready to drink the hemlock if the verdict requires it :)
experimentally yours, Bill