C# UserControl factory

Posted by user1112111 on Stack Overflow See other posts from Stack Overflow or by user1112111
Published on 2010-05-18T10:35:43Z Indexed on 2010/05/18 10:41 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

Let's say you have two classes that extend UserControl. Each of the controls provides a custom event (this could be done by using an interface).

You want to display one of the controls in the odd days and the other in the even days.

You also want to be able to drag&drop (Visual Studio) the UserControl on your form without knowing what the Control type will finally be.

How do you do that ? Is the factory pattern useful here ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about usercontrol