a project for control??

R

rua17

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?
 
C

Chris Bower

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.
 
R

rua17

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??
 
C

Chris Bower

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?
 
R

rua17

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
 
C

Chris Bower

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.
 
R

rua17

thanks a lot...



Chris Bower said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top