win form中imagelist资源问题? 其实也不会啦,或者你可以单独写一个类,封装ImageList,然后在全部的类中去调用它 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以专门写一个imagelist放图形的类,当你需要什么样的图形时就对该 imagelist进行重写图片存放地址! 同意snofps:snow wolf==>snof 历害 我在程序中用过一个好方法, 现公布如下:比如,在一个项目中有一个Form1和一个Form6,在Form1中有imageList1资源, 可以通过这种方式访问, 让Form6中的toolbar访问Form1中的ImageList资源//取Form1的资源System.Resources.ResourceManager resource = new System.Resources.ResourceManager(typeof(Form1));//取得imagelist1的资源流System.Windows.Forms.ImageListStreamer imgliststream = ((System.Windows.Forms.ImageListStreamer)(resource.GetObject("imageList1.ImageStream")));//给Form6中的ImageList赋值ImageList imglist = new ImageList();imglist.ImageStream = imgliststream;toolBar1.ImageList = imglist;//设置工具条图标索引toolBar1.Buttons[0].ImageIndex = 0;toolBar1.Buttons[1].ImageIndex = 1; 数据库练级字符串 wince中使用httpwebrequest如何保存session FileUpload控件能上传视频吗 请教 windows2003server中DCom的配置问题 textbox.text 类型转换问题 登录信息采用cookie保存的问题 求助动态加载图片时闪烁 问个关于设计模式的问题 怎么把HTML的画面快速转化为C#的画面 c#的串口如何使用 XML的简单读取问题,急!,谢谢! 如何让treeview响应鼠标右键点击事件?
ps:snow wolf==>snof 历害
在Form1中有imageList1资源, 可以通过这种方式访问, 让Form6中的toolbar访问Form1中的ImageList资源//取Form1的资源
System.Resources.ResourceManager resource = new System.Resources.ResourceManager(typeof(Form1));
//取得imagelist1的资源流
System.Windows.Forms.ImageListStreamer imgliststream = ((System.Windows.Forms.ImageListStreamer)(resource.GetObject("imageList1.ImageStream")));
//给Form6中的ImageList赋值
ImageList imglist = new ImageList();
imglist.ImageStream = imgliststream;
toolBar1.ImageList = imglist;
//设置工具条图标索引
toolBar1.Buttons[0].ImageIndex = 0;
toolBar1.Buttons[1].ImageIndex = 1;