UITypeEditor示例-boost电路计算模版——mathcad

时间:2021-06-09 23:59:45
【文件属性】:
文件名称:UITypeEditor示例-boost电路计算模版——mathcad
文件大小:5.1MB
文件格式:PDF
更新时间:2021-06-09 23:59:45
控件,.NET 图 2.4 UITypeEditor示例 2.5.2 TypeConverters 在属性窗口中,像字体和大小等属性是一个内置的对象,其有若干个属性构成,在属性 窗口中,这个属性前面都会有一个+号,可以点击展开并对其每个属性进行配置。对于自定 义控件来说,如果控件中包含类似的属性,那么可以通过 TypeConverters 来实现属性窗 口呈现+号的效果。 假设我们已经定义了一个 Person类,其中包含两个属性(Name和 PhoneNum)。然后 我们定义一个继承自 TypeConverter的 PersonTypeConverter类型转换器,代码如下: using System; using System.ComponentModel; namespace MingForm.Controls { public class PersonTypeConverter : TypeConverter { public PersonTypeConverter() { } public override bool GetPropertiesSupported( ITypeDescriptorContext context) { return true; } public override PropertyDescriptorCollection GetProperties( ITypeDescriptorContext context, object value,

网友评论