Results 1 to 2 of 2

Thread: [2.0] Usercontrols and Interfaces confusion

  1. #1

    Thread Starter
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    [2.0] Usercontrols and Interfaces confusion

    I have an application that has a handful of UserControls that all implement the same interface.... they are different variations of a display with a couple of mehtods for raising events.

    The trouble is, I want to generically reference these guys, Ideally as a user control when I need to place them and as the Interface when I need to set data and register for events. I've gotten away with this in the past by casting them as the concrete type upon creation, but this time, I plan on loading them into a LIST<whatever> to call up as needed. I'm trying to avoid having a separate referece of the concrete type hanging out in my app.

    I'll try and post some c0d if I get some time.
    Merry Christmas

  2. #2
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    Re: [2.0] Usercontrols and Interfaces confusion

    In your project is it possible to use a base class for your user controls instead of an interface? It would allow you to put the interface methods into the base class and allow you to derive from UserControl. Then you would have a List<MyUserControlBase> which allows access to both sets of methods.
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width