User Control functionality

hi

Can any one clear up my mind when do you really need to add the usercontrol form to your project/solution, what exactly is its funtionality.

pls show me few basic samples.




Answer this question

User Control functionality

  • telectro

    When you only need a container, you should use Panel's. But when you want a full functional control that you can use in your whole project and even can be reused in other projects you need to create a UserControl.

    A Panel is only a contrianer for controls, nothing less, nothing more. You use this to dock some labels, comboboxes etc on your form.
    But when you build a LoginControl for example, that check usernames and passwords and does some login logic you create a Usercontrol. A Usercontrol can contain panel for layout and a panel can control a usercontrol.

    Use a Usercontrol when you really want to create your own control that is reusable and use panel for layout work.

    You can take a look at codeproject, here are some nice articles about how to create your own control, a little list: I hope this helps.


  • User Control functionality