<Class Name="TCPComponent.TCPHelper">
<DesktopCompatible>
true
</DesktopCompatible>
<Property Name="Port">
<Category>自定义</Category>
<DefaultValue>
<Type>System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
<Value>0</Value>
</DefaultValue>
<Description>此处设置远程主机的端口号,应该在1024至65535的范围内设定,测试时请和服务器端设为相同端口</Description>
<Browsable>true</Browsable>
</Property>
<Property Name="HostName">
<Category>自定义</Category>
<DefaultValue>
<Type>
System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</Type>
<Value>192.168.1.1</Value>
</DefaultValue>
<Description>此处设置远程主机的IP地址,应该以4点分发进行输入,测试时请输入服务器ip地址</Description>
<Browsable>
true
</Browsable>
</Property>
</Class>
再编译一下,重新把工具箱中的组件拖入设计界面,是不是就有属性描述和分类了呢?如下图:

ok,这里基本上,就完成了一个基本组件的设置,在下一篇的随笔,我将介绍如何为组件添加方法,以及属性默认值的处理。
作者:Jack Fan(初学博闻 of .NET CF/.Net)
出处:http://longqi293.cnblogs.com
编辑:http://www.xueit.com
本博文欢迎大家浏览和转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,在『参考』的文章中,我会表明参考的文章来源,尊重他人版权。若您发现我侵犯了您的版权,请及时与我联系。