Click here to Skip to main content
15,070,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all i am comparing two objects in if condtion, but its showing some error this is my code here

Dim red As Object = Global.Frogy_Main_Screen.My.Resources.Resources.red_chair

          Dim clkchr As Object = cb.BackgroundImage

          If clkchr = red Then
          End If

here cb is my button control

i am facing this kind of error. the error is

"Operator '=' is not defined for type 'Bitmap' and type 'Bitmap'."

how shall i fix this error.
DaveAuld 22-Dec-10 11:36am
Have you tried if clkchr.equals(red) ?

You can use Object.Equals()[^]

Or you could implement it yourself (if needed):[^]

Good luck!
if clkchr.Equals(red) then
end if

EDIT ==========

Oops, Dave got there 1st. :)


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900