不久前我使用设计器创建了一个ImageList
for a ListView
。现在我正在寻找那些图像和控制代码ImageList
但找不到它。 ”查找所有参考文献“没有显示全部内容(我以为它会在InitializeComponent
).
我可以使用设计器来设置ImageSize
,但在代码中找不到它。不仅如此 - 如果我在调用后手动添加它InitializeComponent
- 图像在运行时消失。
我在任何地方都找不到图像解决方案浏览器任何一个。
说清楚一点——图像do在运行时显示。
当您将资源添加到表单时(ImageList
, form Icon
等),它将保存在表单资源(resx-file)中。
它们会自动加载到InitializeComponent()
方法,在表单构造函数中调用。
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
...
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
...
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
...
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)