Results 1 to 2 of 2

Thread: Picture1.Picture Isnull()

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2016
    Posts
    80

    Picture1.Picture Isnull()

    Hi,
    how can I detect if Picture1.Picture is null or if Picture1 contains a picture?
    I tried :

    1) MsgBox (Picture1.Picture = Picture1.LoadPicture("")) -> returns: method not found
    2) MsgBox (IsObject(Picture1.Picture)) -> returns always true
    3) MsgBox IsNull(Picture1.Picture) -> returns always false

    ..without success.

  2. #2
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Picture1.Picture Isnull()

    Try something like this:

    Code:
        Select Case True
        Case Picture1.Picture Is Nothing, Picture1.Picture.Handle = 0
            MsgBox "Empty"
        Case Else
            MsgBox "Non-empty"
        End Select
    There is no picture shown if the Picture property is set to Nothing or when it does have an StdPicture object set but it's handle is zero.

    The second case can be simulated with Set Picture1.Picture = LoadPicture -- this loads an empty StdPicture with Handle = 0

    cheers,
    </wqw>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width