我给控件添加属性的时候DefaultValue("abc")已经设置了,可是为什么编译完后初始值不是"abc"???
请教各位。
代码如下:
[Category("Appearance"), Description("文本框显示的内容"),DefaultValue("abc")] public override string Text
{
get
{
return txtDate.Text;
}
set
{
txtDate.Text = value;
}
}
请教各位。
代码如下:
[Category("Appearance"), Description("文本框显示的内容"),DefaultValue("abc")] public override string Text
{
get
{
return txtDate.Text;
}
set
{
txtDate.Text = value;
}
}
解决方案 »
- 算法问题(4字节表示多个数字)
- vs 2005怎样打开VB写的工程?
- 关于WWF(Windows Workflow Fundation)相关的WCF工作流服务库
- DataGridView 如何传递选中行的id值到另外一个窗体
- 问下dotnet类库有没有提供HOOK API的类或函数
- SOCKET(TCP)不能传送中文的问题
- 软件开发过程所用到的工具大全
- 求c#控制鼠标的移动的思路
- INNO SETUP在安装过程中实现附加数据库
- 为什么提示我这个错了radioButton1.Checked = false && radioButton2.Checked = false
- UDP如何循环接收消息。。。
- 关于static成员的问题
{
// Gets the attributes for the property.
object attr = TypeDescriptor.GetProperties(this)["Text"].Attributes[typeof(DefaultValueAttribute)];
DefaultValueAttribute defAttr = attr as DefaultValueAttribute;
if (defAttr != null)
{
return defAttr.Value as string;
}
}
return this.txtDate.Text;