custom control

D

dragonslayer008

I need to make a custom control from scratch. Petzold's book
"Programming Microsoft Windows Forms a Streamlined Approach using C#"
derives from Control. But when I made a new "Windows Forms Control
Library" project, it derived from UserControl. So which should I use:
Control or UserControl and what is the difference?
 
G

Guest

UserControl inherits from ContainerControl and can function as a container
for other controls. You can use Visual Studio Designer to design your control
that inherits from UserControl. I would inherit from a Control instead of
UserControl if I needed a jazzy TextBox or something simple that wouldn't be
composed of more than one control.

HTH
 

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

Top