MikeD
7/21/2012 11:54:00 PM
"Larry Serflaten" <serflaten@gmail.com> wrote in message
news:3d7f469c-7d64-4e82-bcbb-e663c2f0bfcb@googlegroups.com...
> BeeJ wrote:
>
>> How else can I do ImageExists?
>
>
> Keep it simple....
>
> LFS
>
>
> Option Explicit
> Private Keys As String
> Const Delimiter = "*"
>
> Private Sub Form_Initialize()
> Keys = Delimiter
> End Sub
>
> Private Function KeyExists(Key As String) As Boolean
> KeyExists = CBool(InStr(Keys, Delimiter & UCase$(Key) & Delimiter))
> End Function
>
> Private Sub ImgAdd(Key As String, Img As StdPicture)
> If Not KeyExists(Key) Then
> ' imlIcons.ListImages.Add(, UCase$(sKey), Img.Image)
> Keys = Keys & UCase$(Key) & Delimiter
> End If
> End Sub
>
Just curious, but how is that simpler than just trapping for a specific
error number?
Mike