Question Adding properities to child components

mes5464

New member
Joined
Apr 2, 2013
Messages
1
Programming Experience
10+
The tablelayoutgrid adds properties to controls dropped on it. I want to learn how to do this. Can anyone point me in the right direction?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,219
Location
Sydney, Australia
Programming Experience
10+
It's a TableLayoutPanel. Please use the correct names for things to avoid confusion. It was obvious in this case what you actually meant but may not always be.

What you're asking for is done by implementing the IExtenderProvider interface. Another example of this is the ToolTip component. The properties you speak of are not actually properties. They appear in the Properties window in the designer because the VS designer understands the IExtenderProvider interface but, if you want to access that functionality in code, it's actually done via methods of the provider rather than properties of the client component.

Here's an example I created that uses the IExtenderProvider interface to approximate the control array functionality available in VB6. The code is VB.NET but the principles are exactly the same.

Control Arrays in VB.NET
 
Top Bottom