Display an image into windows forms

前端 未结 4 1852
借酒劲吻你
借酒劲吻你 2021-02-07 11:51

I wanted to display an image to the windows forms, but i already did this and the image did not come out.

Where did I go wrong?

Here is the code:



        
4条回答
  •  渐次进展
    2021-02-07 12:19

    I display images in windows forms when I put it in Load event like this:

        private void Form1_Load( object sender , EventArgs e )
        {
            pictureBox1.ImageLocation = "./image.png"; //path to image
            pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
        }
    

提交回复
热议问题