VB2008 How to check for a Null Bitmap in an Array

I have an array of type bitmap and I want to check if an element is empty or not. Something like:

Dim FlagBitmap(8) As Bitmap
...
If FlagBitmap(RandomInteger) = DBNull.Value Then

But I keep getting an error because zero or null cannot be used with = with a bitmap. Can anyone help?
LVL 1
onewheelhkAsked:
Who is Participating?
 
Wayne Taylor (webtubbs)Connect With a Mentor Commented:
If FlagBitmap(RandomInteger) Is Nothing Then

Wayne
0
 
DhaestCommented:
Can you try this
if FlagBitmap(RandomInteger) = Null
0
 
clinton_cunninghamCommented:
IsNothing: Example

Public Sub test()
    Dim o As Bitmap

    If IsNothing(O) Then
        Debugger.Break()
    End If
End Sub
0
 
onewheelhkAuthor Commented:
I tried

If FlagBitmap(RandomInteger) = Null  

Error says Null constant is no longer supported

I've just tried

If FlagBitmap(RandomInteger) Is Nothing

and that seems to work. Excellent. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.