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;
4
5 namespace customcontrolsample
6 {
7 public class firstcontrol: Control
8 {
9 private int simplefield;
10
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 ;}
17}
18
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 )));
23}
24}
25}
The end.