Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#自定义控件:使用内部内容作为文本字段_C#_Custom Controls - Fatal编程技术网

C#自定义控件:使用内部内容作为文本字段

C#自定义控件:使用内部内容作为文本字段,c#,custom-controls,C#,Custom Controls,我正在创建一个自定义控件,我想获取标记中的所有内容,并将其用作控件上的字符串文本字段: i、 e 在控制类上: [ParseChildren(true, "TextPropertyNameHere")] [PersistChildren(false)] 在控件的属性上: [PersistenceMode(PersistenceMode.InnerDefaultProperty)] 或者类似的 [ParseChildren(true, "TextPropertyNameHere")] [Per

我正在创建一个自定义控件,我想获取标记中的所有内容,并将其用作控件上的字符串文本字段:

i、 e

在控制类上:

[ParseChildren(true, "TextPropertyNameHere")]
[PersistChildren(false)]
在控件的属性上:

[PersistenceMode(PersistenceMode.InnerDefaultProperty)]
或者类似的

[ParseChildren(true, "TextPropertyNameHere")]
[PersistChildren(false)]
[PersistenceMode(PersistenceMode.InnerDefaultProperty)]