. NET component Control instance programming series--2. Simulate the components of a Web page link with a Label control

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.