Inheriting a control

Discussion in 'ASP .Net Building Controls' started by Ant, Jul 24, 2006.

  1. Ant

    Ant Guest

    Hi,
    Firstly, I'm not using ASP , I'm using winForms but I can't seem to find a
    winforms building controls thread. If anybody knows of such a thread in this
    forum I'd be most grateful.

    The problem I'm having is I'm creating a control using a class library. This
    class is inheriting a Checkbox. I want to create a simple Toggle Button
    control.

    After setting a reference to the windows forms dll, I inherit the checkbox
    class in the normal fashion:

    public class MyToggleButton : CheckBox{//code here}

    I build ok.

    When I add a reference to this assembly, it recognises the reference but no
    control appears on my MyUserControls tab. Why is this so?

    I have created controls using control libraries with no problems. Why can't
    I inherit from a standard control & see it on MyUserControls?

    Thanks for any clues in advance.
    Ant
     
    Ant, Jul 24, 2006
    #1
    1. Advertising

  2. Ant

    Ant Guest

    Hi,

    I worked out how to add it, by using the Add/Remove items on the tool box.
    But this leaves me with a question.

    Why do I need to add a referene to a control library from the project menu

    but I need to use Add/Remove to add a class library control? what is the
    difference?

    Thanks for any thoughts
    Ant



    "Ant" wrote:

    > Hi,
    > Firstly, I'm not using ASP , I'm using winForms but I can't seem to find a
    > winforms building controls thread. If anybody knows of such a thread in this
    > forum I'd be most grateful.
    >
    > The problem I'm having is I'm creating a control using a class library. This
    > class is inheriting a Checkbox. I want to create a simple Toggle Button
    > control.
    >
    > After setting a reference to the windows forms dll, I inherit the checkbox
    > class in the normal fashion:
    >
    > public class MyToggleButton : CheckBox{//code here}
    >
    > I build ok.
    >
    > When I add a reference to this assembly, it recognises the reference but no
    > control appears on my MyUserControls tab. Why is this so?
    >
    > I have created controls using control libraries with no problems. Why can't
    > I inherit from a standard control & see it on MyUserControls?
    >
    > Thanks for any clues in advance.
    > Ant
     
    Ant, Jul 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z. f.
    Replies:
    0
    Views:
    344
    z. f.
    Sep 5, 2004
  2. Arvind
    Replies:
    3
    Views:
    6,817
  3. Danny Ni
    Replies:
    1
    Views:
    318
    David Jessee
    Jan 16, 2005
  4. Replies:
    1
    Views:
    395
    Kevin Spencer
    Aug 17, 2005
  5. wapsiii
    Replies:
    1
    Views:
    1,046
    Darren Kopp
    Mar 31, 2006
Loading...

Share This Page