[英]How do I control the order of ExpandableObject properties in the winforms property grid?
[英]How do I make an image property in a winforms user control available in the properties window
在我实现的winforms用户控件上,我想公开一个属性,该属性允许用户选择将在该控件上显示的图像。 我尝试将属性同时显示为图像和位图,尝试尝试指定看起来很有希望的各种属性,但是无论我做什么,该属性都不会出现在“属性”窗口中。 我正在寻找的是标准属性窗口界面,该界面可让您浏览与属性关联的图像。 我怀疑自己会因错过这一明显的东西而踢自己,但我一直在画空白!
这是一个对我有用的示例:
private Image image;
public Image Image
{
get
{
return image;
}
set
{
image = value;
}
}
将代码添加到UserControl
,请确保您进行了重建,然后Image属性应出现在Properties窗口中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.