custom control

  • Thread starter Thread starter dragonslayer008
  • Start date Start date
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?
 
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
 
Back
Top