代码如下:
       Bitmap myPicLoad = new Bitmap(temp1);//temp1是文件路径(是png格式的)
       PictureBox PicLoad = new PictureBox();
       PicLoad.Width  = 8;
       PicLoad.Height = 13;
       PicLoad.Location = new Point(25,45);
       PicLoad.BackgroundImage = myPicLoad;
       PicLoad.Visible = true;
       PicLoad.Show();
但是不会显示出来.
请大家给我看看.....
很急....

解决方案 »

  1.   

    你需要把picturebox加载在某个容器中,例如form或者panel
    例如:
    Bitmap myPicLoad = new Bitmap(temp1);//temp1是文件路径(是png格式的)
    PictureBox PicLoad = new PictureBox();
    PicLoad.Left = 0;//Set left position
    PicLoad.Top =0;//Set top position
    PicLoad.Width = 8;
    PicLoad.Height = 13;
    PicLoad.Location = new Point(25,45);
    PicLoad.BackgroundImage = myPicLoad;
    PicLoad.Visible = true;
    this.Controls.Add( PicLoad );//Add control into form
      

  2.   

    赞成Knight94(愚翁),lz是把 pictureBox初始化了但没有装到容器里