Error PictureBox.Image My.Resources.user_add

0

Hello, I'm developing my CBT and have an error that I can not solve ... Below is the code:

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

That is, I want the program to enter "If" only if the image that is in the PictureBox named imgAluno is not the user_add image, which is in the project resources, but with that code above I get the following error: / p>

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

I've tried the code below, but it did not work either ...

If (Not imgAluno.Image.Equals(My.Resources.user_add)) Then
    
asked by anonymous 25.01.2017 / 04:42

1 answer

0

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

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

End If
    
25.01.2017 / 11:29