Development of the dot net winform control (5) subattributes of complex attributes

Source: Internet
Author: User
Tags dot net

See it? The sub-attribute Max and min of the complexproperty attribute can also be edited.

To implement these functions, you only need to reload two methods in the type converter of this attribute to 1/*** /// <summary>
2 // use the specified context to return whether the object supports properties ).
3 /// </Summary>
4 Public override bool getpropertiessupported (itypedescriptorcontext context)
5 {
6 RETURN true;
7}
8
9/** // <summary>
10 // use the specified context and attribute to return a set of attribute types specified by the value parameter.
11 /// </Summary>
12 public override propertydescriptorcollection getproperties (itypedescriptorcontext context, object value, system. Attribute [] attributes)
13 {
14 return typedescriptor. getproperties (typeof (simplecustomtype), attributes );
15}
16

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