代码之家  ›  专栏  ›  技术社区  ›  benjiiiii

在用户控件中设置ImageBox的图像-c#

  •  0
  • benjiiiii  · 技术社区  · 8 年前

     if (File.Exists(filePath))
     {
          flowProd.Controls["picture_product"].BackgroundImage = Image.FromFile(filePath);
     }
    

    这个 .Image

    1 回复  |  直到 8 年前
        1
  •  1
  •   Ali Yousefi    8 年前

    ((PictureBox)flowProd.Controls["picture_product"]).Image = Image.FromFile(filePath);