Pregunta

I have 2 images in my Project's Resources and I want to make an If statement to see if a picture box has one, if that happens, I want to change to another image. I have something like this but it does not work:

 If  pic1.BackgroundImage Is Global.images.My.Resources.ima1 Then
 pic1.BackgroundImage = Global.images.My.Resources.ima2
End If

Am I right? or what else can I do to it to get that?

¿Fue útil?

Solución

If  pic1.BackgroundImage = Global.images.My.Resources.ima1 Then
 pic1.BackgroundImage = Global.images.My.Resources.ima2
End If

Otros consejos

    If IsNothing(pic.BackgroundImage) Then
        pic.BackgroundImage = simple.My.Resources.Resources.Winter
    End If
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top