Display an image into windows forms

前端 未结 4 1798
借酒劲吻你
借酒劲吻你 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:24

    There could be many reasons for this. A few that come up quickly to my mind:

    1. Did you call this routine AFTER InitializeComponent()?
    2. Is the path syntax you are using correct? Does it work if you try it in the debugger? Try using backslash (\) instead of Slash (/) and see.
    3. This may be due to side-effects of some other code in your form. Try using the same code in a blank Form (with just the constructor and this function) and check.

提交回复
热议问题