Starting from this article, we will illustrate how to implement component control programming. In the previous article, it is mentioned that the combination of component programming can achieve the effect of flexible adding function. So how is the combination? It is generally through events that the control's related events are handled in the Assembly, and the required functionality is encapsulated in the event handler.
The example in this article is to simulate the effect of a Web page link with a label. The LinkLabel control is already available in the. NET control Library, but the control forces an underscore, and only the link color can be changed, and the background color cannot be changed. Here by processing the label control mouse events, dynamically changing its display related properties, you can simulate the effect of the Web page link. And in the event can add more effect, than LinkLabel control more gorgeous.
The following describes the implementation process.
First open vs.net, create the project, select the project type as the class library, enter the project name Simulatelinklabel, and then determine.
When the project is established, right-click the project point in Solution Explorer and select Add Component.