custom control

R

rajendra

hi i am rajendra i am posting my first question to this group i have
doubt from last few days .i want to clear it

why we need user control and wher should we use it,and the execution
of the user defined control. please let me know
 
P

Peter Duniho

rajendra said:
hi i am rajendra i am posting my first question to this group i have
doubt from last few days .i want to clear it

why we need user control and wher should we use it,and the execution
of the user defined control. please let me know

Typically you'd use a UserControl where what you want is a composite of
existing controls. You'd create an instance of the UserControl either
by creating it standalone as a new item in your project, or by simply
dropping a new UserControl instance on your Form.

If you do the former method, it's similar to creating a Form-derived
class. You get a whole new class, which you can then reuse in any
number of forms. You can even put it in its own project and reuse it in
multiple projects.

Don't confuse a UserControl with a "custom Control", which is a
completely customized class derived from Control, in which you
completely define the behavior of the class. A UserControl brings along
with it some default behavior that is especially useful when composing a
new control that itself contains several other controls.

Pete
 

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