a project for control??

Discussion in 'ASP .Net Building Controls' started by rua17, Nov 17, 2003.

  1. rua17

    rua17 Guest

    I want to create a library of my custom controls, can I create a lot of
    controls in one project or I need one project per control?
     
    rua17, Nov 17, 2003
    #1
    1. Advertising

  2. rua17

    Chris Bower Guest

    You can put all of your controls into one project and have it compile down
    to a single assembly. You can then add that assembly to your toolbox, etc so
    you can Drag & Drop your custom controls from the toolbox.


    "rua17" <> wrote in message
    news:%...
    > I want to create a library of my custom controls, can I create a lot of
    > controls in one project or I need one project per control?
    >
    >
     
    Chris Bower, Nov 17, 2003
    #2
    1. Advertising

  3. rua17

    rua17 Guest

    thanks.

    I'm trying to create a control that inherits from button Class, if I choose
    add user control, a control container appears, how can I only have the
    button control on the screen??

    "Chris Bower" <> wrote in message
    news:#E$...
    > You can put all of your controls into one project and have it compile down
    > to a single assembly. You can then add that assembly to your toolbox, etc

    so
    > you can Drag & Drop your custom controls from the toolbox.
    >
    >
    > "rua17" <> wrote in message
    > news:%...
    > > I want to create a library of my custom controls, can I create a lot of
    > > controls in one project or I need one project per control?
    > >
    > >

    >
    >
     
    rua17, Nov 17, 2003
    #3
  4. rua17

    Chris Bower Guest

    Hmm, can you paste your inherited code? If you're creating a class like this
    (VB syntax):

    Public Class myButton
    Inherits Button
    ....
    End Class

    It should display just fine. Are you overriding the Render method or
    anything?

    "rua17" <> wrote in message
    news:...
    > thanks.
    >
    > I'm trying to create a control that inherits from button Class, if I

    choose
    > add user control, a control container appears, how can I only have the
    > button control on the screen??
    >
    > "Chris Bower" <> wrote in message
    > news:#E$...
    > > You can put all of your controls into one project and have it compile

    down
    > > to a single assembly. You can then add that assembly to your toolbox,

    etc
    > so
    > > you can Drag & Drop your custom controls from the toolbox.
    > >
    > >
    > > "rua17" <> wrote in message
    > > news:%...
    > > > I want to create a library of my custom controls, can I create a lot

    of
    > > > controls in one project or I need one project per control?
    > > >
    > > >

    > >
    > >

    >
    >
     
    Chris Bower, Nov 17, 2003
    #4
  5. rua17

    rua17 Guest

    I did something like this
    I create a new project ->new class library

    I put this code in c#

    public class command_std:Button

    {

    ....

    }



    I clicked the command_std Preview and it tells me:



    To add components....



    what am I doing wrong???

    As I tell you before if I chose new project .> user control library, a
    container appears



    thanks





    "Chris Bower" <> wrote in message
    news:#...
    > Hmm, can you paste your inherited code? If you're creating a class like

    this
    > (VB syntax):
    >
    > Public Class myButton
    > Inherits Button
    > ...
    > End Class
    >
    > It should display just fine. Are you overriding the Render method or
    > anything?
    >
    > "rua17" <> wrote in message
    > news:...
    > > thanks.
    > >
    > > I'm trying to create a control that inherits from button Class, if I

    > choose
    > > add user control, a control container appears, how can I only have the
    > > button control on the screen??
    > >
    > > "Chris Bower" <> wrote in message
    > > news:#E$...
    > > > You can put all of your controls into one project and have it compile

    > down
    > > > to a single assembly. You can then add that assembly to your toolbox,

    > etc
    > > so
    > > > you can Drag & Drop your custom controls from the toolbox.
    > > >
    > > >
    > > > "rua17" <> wrote in message
    > > > news:%...
    > > > > I want to create a library of my custom controls, can I create a lot

    > of
    > > > > controls in one project or I need one project per control?
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    rua17, Nov 17, 2003
    #5
  6. rua17

    Chris Bower Guest

    Ohh, I see what you mean. When you're building a control like that (by
    adding a class library), you (at least as far as I'm aware of) can't design
    the control as such. If you're going to inherit from the Button class and
    you want to add extra elements, you'll have to do it manually in your code.
    The best way to do this is in the CreateChildControls method. You can also
    override the Render and RenderChildren methods, etc.

    "rua17" <> wrote in message
    news:...
    > I did something like this
    > I create a new project ->new class library
    >
    > I put this code in c#
    >
    > public class command_std:Button
    >
    > {
    >
    > ...
    >
    > }
    >
    >
    >
    > I clicked the command_std Preview and it tells me:
    >
    >
    >
    > To add components....
    >
    >
    >
    > what am I doing wrong???
    >
    > As I tell you before if I chose new project .> user control library, a
    > container appears
    >
    >
    >
    > thanks
    >
    >
    >
    >
    >
    > "Chris Bower" <> wrote in message
    > news:#...
    > > Hmm, can you paste your inherited code? If you're creating a class like

    > this
    > > (VB syntax):
    > >
    > > Public Class myButton
    > > Inherits Button
    > > ...
    > > End Class
    > >
    > > It should display just fine. Are you overriding the Render method or
    > > anything?
    > >
    > > "rua17" <> wrote in message
    > > news:...
    > > > thanks.
    > > >
    > > > I'm trying to create a control that inherits from button Class, if I

    > > choose
    > > > add user control, a control container appears, how can I only have the
    > > > button control on the screen??
    > > >
    > > > "Chris Bower" <> wrote in message
    > > > news:#E$...
    > > > > You can put all of your controls into one project and have it

    compile
    > > down
    > > > > to a single assembly. You can then add that assembly to your

    toolbox,
    > > etc
    > > > so
    > > > > you can Drag & Drop your custom controls from the toolbox.
    > > > >
    > > > >
    > > > > "rua17" <> wrote in message
    > > > > news:%...
    > > > > > I want to create a library of my custom controls, can I create a

    lot
    > > of
    > > > > > controls in one project or I need one project per control?
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Chris Bower, Nov 17, 2003
    #6
  7. rua17

    rua17 Guest

    thanks a lot...



    "Chris Bower" <> wrote in message
    news:...
    > Ohh, I see what you mean. When you're building a control like that (by
    > adding a class library), you (at least as far as I'm aware of) can't

    design
    > the control as such. If you're going to inherit from the Button class and
    > you want to add extra elements, you'll have to do it manually in your

    code.
    > The best way to do this is in the CreateChildControls method. You can also
    > override the Render and RenderChildren methods, etc.
    >
    > "rua17" <> wrote in message
    > news:...
    > > I did something like this
    > > I create a new project ->new class library
    > >
    > > I put this code in c#
    > >
    > > public class command_std:Button
    > >
    > > {
    > >
    > > ...
    > >
    > > }
    > >
    > >
    > >
    > > I clicked the command_std Preview and it tells me:
    > >
    > >
    > >
    > > To add components....
    > >
    > >
    > >
    > > what am I doing wrong???
    > >
    > > As I tell you before if I chose new project .> user control library, a
    > > container appears
    > >
    > >
    > >
    > > thanks
    > >
    > >
    > >
    > >
    > >
    > > "Chris Bower" <> wrote in message
    > > news:#...
    > > > Hmm, can you paste your inherited code? If you're creating a class

    like
    > > this
    > > > (VB syntax):
    > > >
    > > > Public Class myButton
    > > > Inherits Button
    > > > ...
    > > > End Class
    > > >
    > > > It should display just fine. Are you overriding the Render method or
    > > > anything?
    > > >
    > > > "rua17" <> wrote in message
    > > > news:...
    > > > > thanks.
    > > > >
    > > > > I'm trying to create a control that inherits from button Class, if I
    > > > choose
    > > > > add user control, a control container appears, how can I only have

    the
    > > > > button control on the screen??
    > > > >
    > > > > "Chris Bower" <> wrote in message
    > > > > news:#E$...
    > > > > > You can put all of your controls into one project and have it

    > compile
    > > > down
    > > > > > to a single assembly. You can then add that assembly to your

    > toolbox,
    > > > etc
    > > > > so
    > > > > > you can Drag & Drop your custom controls from the toolbox.
    > > > > >
    > > > > >
    > > > > > "rua17" <> wrote in message
    > > > > > news:%...
    > > > > > > I want to create a library of my custom controls, can I create a

    > lot
    > > > of
    > > > > > > controls in one project or I need one project per control?
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    rua17, Nov 17, 2003
    #7
    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. Claude seraphin
    Replies:
    12
    Views:
    2,545
    samundersingh1983
    Feb 15, 2014
  2. Ken Stealth
    Replies:
    2
    Views:
    4,379
    =?Utf-8?B?amRneChDb2xvbWJpYSk=?=
    Jan 31, 2004
  3. Brad
    Replies:
    2
    Views:
    590
    Kevin Spencer
    Apr 1, 2004
  4. Raterus
    Replies:
    2
    Views:
    862
    Joe Fallon
    Apr 28, 2004
  5. moondaddy
    Replies:
    4
    Views:
    756
    Steven Cheng[MSFT]
    Jul 27, 2004
Loading...

Share This Page