Dot NET winform control development (2) give the control some descriptions

Source: Internet
Author: User
Tags dot net
Attribute is used here. attribute is different from attribute. The former is used to describe programming elements, and the latter is used to describe objects. simply put, do not scold me if you are wrong !!!

Slightly changed a piece of code: 1 using system. componentmodel;
2 using system. Windows. forms;
3 using system. drawing;
5 namespace customcontrolsample
6 {
7 public class firstcontrol: Control
8 {
9 private int simplefield;
11 [category ("I Am a property, but I am afraid of it! ")]
12 [description ("I Am a property, so I am in (property browser )! ")]
13 public int simpleproperty
14 {
15 get {return simplefield ;}
16 set {simplefield = value ;}
19 protected override void onpaint (painteventargs E)
20 {
21 base. onpaint (E );
22 E. Graphics. drawrectangle (pens. Red, new rectangle (point. Empty, new size (width-1, height-1 )));

The end.

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: 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.