I have a search usercontrol that I'd like to make generic.
The control itself will contain a different collection of controls dependent on its context. For example it could be stock items, people, address as the context of the search..
How can I make it generic enough that based upon the search context it knows exactly what user controls it needs on the form?
Any programmer can then just drag the user control onto their form, set it's context and we are good to go.
My first thought is to create a base control for all the individual user controls and the search dialog accepts these in the constructor so it knows which ones to show at runtime. You can create inherited versions of the base controls and pass these in. Or maybe just set the search context (enum) and it showhow works out what the user controls are at runtime.
It's all .net 2.0 Winform
Edited for readibilty. Q was far too lenghty and detailed before.