User Control: allows users to put multiple system controls together and contain relatedCode, Encapsulate it into a collection of controls, so that users can easily repeatedly call this collection. For example, when each form requires a user logon box (including Logon Name, logon password, and submit button), you can put these controls into a new user control, you can call this control on each form, without creating (or copying) A new Login Name, logon password, and submit button control on each form. This combination makes it easier for users to understand. It is equivalent to creating an abstract class.
Override controls: override controls generally inherit system controls and rewrite some of these methods as needed. The override control is an inherited encoding operation. The key is how to call and use the overwritten control? I searched a lot of webpages and did not find the relevant information. I did not find a way to drag and drop the control like a system control, but I dynamically instantiated the control and placed it in a form or control, yes. The sample code is as follows:
1:Gridviewcontrol maid =NewGridviewcontrol ();// Gridviewcontrol is a class that inherits from the datagridview class and overwrites some methods.
2:Datagridview1.location =NewPoint (10, 10 );// Set the widget location
3:Datagridview1.height = 500;// Define the widget size
4:Maid = 500;
5:Panel1.controls. Add (datagridview1 );// Load the control in Panel1 OF THE FORM