日期:2014-05-18 浏览次数:20881 次
private void button1_Click(object sender, EventArgs e) { //imageList1.Images.Add(pictureBig.Image); //listView1.LargeImageList = imageList1; AddimageList("1", "http://www.baidu.com/img/baidu_sylogo1.gif"); } public void AddimageList(string pid, string smallImage) { imageList1.Images.Add(pid, new Bitmap((new System.Net.WebClient()).OpenRead(smallImage))); listView1.Items.Add(pid, pid); }
private void btnSelected_Click(object sender, EventArgs e) { string productID = label4.Text.Trim(); string smallImageUrl = label2.Text.Trim(); frmMain f = new frmMain(); f.AddimageList(productID, smallImageUrl); }
public partial class Form2 : Form { public frmMain form1; public Form2(frmMain fm1) { form1 = fm1; InitializeComponent(); } private void btnSelected_Click(object sender, EventArgs e) { string productID = label4.Text.Trim(); string smallImageUrl = label2.Text.Trim(); //frmMain f = new frmMain(); f.AddimageList(productID, smallImageUrl); } }
------解决方案--------------------
sorry
private void btnSelected_Click(object sender, EventArgs e)
{
string productID = label4.Text.Trim();
string smallImageUrl = label2.Text.Trim();
frmMain f= (frmMain)this.Owner;
f.AddimageList(productID, smallImageUrl);
}