其实也不会啦,或者你可以单独写一个类,封装ImageList,然后在全部的类中去调用它
解决方案 »
- 当前上下文中不存在名称“HttpContext”
- wcf rest客服端调用java rest 服务
- 如何定位winform控件的事件代码写在哪里?
- 【请教】c#自定义控件的一个问题
- 如何去掉FreetextBox中的html编辑功能
- C# WinForm 的datagridview中如何更改绑定单元格的类型
- 实现把图片上传到数据库
- 动态加载UerControl 后的 Anchor 属性问题
- 急。。。急。。。帮忙解决问题后,再送100分!!!!!!!
- System.Runtime.InteropServices在哪个位置
- 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;