帮助,我无法将我的属性放入设计器 PropertyGrid 中
这有什么问题吗?属性 LeftImage 没有显示在 PropertyGrid (WinForms .NET 3.5) 中
private Image _LeftImage;
/// <summary>
/// Sets the small image appearing to the left of the trackbar
/// </summary>
[
Description("The small image appearing to the left of the trackbar"),
Category("Appearance"),
EditorAttribute(typeof(System.Drawing.Design.ImageEditor), typeof(System.Drawing.Design.UITypeEditor)),
DefaultValueAttribute(typeof(Image),"null"),
Browsable(true), EditorBrowsable(EditorBrowsableState.Always)
]
public Image LeftImage
{
private get { return _LeftImage; }
set
{
if (value.Height != 16 || value.Width != 16)
{
_LeftImage = new Bitmap(value,new Size(16,16));
}
else _LeftImage = value;
Invalidate();
}
}
我哪里出错了??? IDE 不会抱怨任何事情,并且编译良好,并且所有其他属性都显示正常。有什么想法吗?
What is wrong with this? The property LeftImage doesn't show up in the PropertyGrid (WinForms .NET 3.5)
private Image _LeftImage;
/// <summary>
/// Sets the small image appearing to the left of the trackbar
/// </summary>
[
Description("The small image appearing to the left of the trackbar"),
Category("Appearance"),
EditorAttribute(typeof(System.Drawing.Design.ImageEditor), typeof(System.Drawing.Design.UITypeEditor)),
DefaultValueAttribute(typeof(Image),"null"),
Browsable(true), EditorBrowsable(EditorBrowsableState.Always)
]
public Image LeftImage
{
private get { return _LeftImage; }
set
{
if (value.Height != 16 || value.Width != 16)
{
_LeftImage = new Bitmap(value,new Size(16,16));
}
else _LeftImage = value;
Invalidate();
}
}
Where do i go wrong??? The IDE doesn't complain about anything, and it compiles fine, and all the other properties show up alright. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除 LeftImage 的 get 语句上的私有访问器。将其更改为
Remove the private accessor on get statement of LeftImage. Change it to