Question

I'm trying to make my BackgroundImage of a PictureBox nothing.

I've already tried

BackgroundImage3.BackgroundImage = Nothing
BackgroundImage3.Update() ' it didn't even work without this line of code

and

Dim n0 = Image
BackgroundImage3.BackgroundImage = n0

with no success.

Also, this is the code for the if statement, if it'll help a little:

If (PictureBox3.BackgroundImage Is My.Resources.theimageIwant) Then

Any suggestions?

Was it helpful?

Solution 2

It turns out that I was passing the same function (nothing then image) to another PictureBox right below it. Conflicts cause big problems. Thanks for helping everyone.

OTHER TIPS

In my Visual Studio 2010, this line works well:

BackgroundImage3.BackgroundImage = Nothing   

After execution of this code, background image dissappears; that's what you trying to do?
I'm sure that the problem lies in the context where you've put your BackgroundImage change, so you can post your full code. Post complete procedure, in which you have placed the code above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top