What is the difference between User Control, Custom Control and Component?

后端 未结 4 1965
无人及你
无人及你 2020-11-30 18:22

These are three different things you can add to a project and I am not quite sure if I understand the difference. They all seem to for example show up in the component toolb

4条回答
  •  执念已碎
    2020-11-30 18:55

    I believe the last statement is not correct in my opinion . I create user controls for many different reasons.

    The main reason is so that if per say I design an interface of multiple controls grouped together.

    I first create a class library , then I add user controls to it . Now if i need to change any part of the logic behind how the user control works I can very easily. Also this class library can be used multiple times.

    Also within the same classy library I can have multiple classes that can be shared and used for any of my user controls.

    This is the main reason I use user controls. And if you make a change to your user control or class library . once you build the job . the dll will dynamically up date in the bin folder .

    So if i am referencing this in another project Those changes will also appear in new project .

    Also it doesn't use the same paint routines as the form and anything you have loaded on the form.

    So user controls gives us the ability to be very modular And i Can have multiple user controls that share the basics classes of the class library ... So a user control purpose is just not for one project . It has no limitations in that respect. jeff

提交回复
热议问题