Picturebox.Image error <> My.resources.user_add

Asked

Viewed 34 times

0

Hello, I am developing my TCC and there is an error that I can not solve... Below follows the code:

If (imgAluno.Image <> My.Resources.user_add) Then

That is, I want the program to enter in "If" only if the image that is in Picturebox called imgAluno is not the user_add image, which is in the project’s Resources, but with this code above I get the following error:

Operator '<>' is not defined for types 'Image' and 'Bitmap'

I tried the code below, but it didn’t work either...

If (Not imgAluno.Image.Equals(My.Resources.user_add)) Then

1 answer

0


You are probably trying to include operators in objects. Try using it as follows:

If Not Object.ReferenceEquals(imgAluno.Image, My.Resources.user_add) Then 

End If
  • Thank you, now yes it worked!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.