|
-
May 4th, 2000, 05:57 PM
#1
Thread Starter
Addicted Member
Hello,
I'm developing an OCX.
I have 2 picture properties (PictureLeft and
PictureRight).
If the PictureRight is "empty" then I need to load the
PictureLeft image on it.
My question is: How can I verify if a picture property
is empty (there is no image loaded on it)?
I'm trying to use If PictureRight() = LoadPicture("") but
it's not working.
This is my code:
Public Property Set PictureRight(ByVal New_PictureRight As
Picture)
Set m_PictureRight = New_PictureRight
PropertyChanged "PictureRight"
End Property
Public Property Set PictureLeft(ByVal New_PictureLeft As
Picture)
Set m_PictureLeft = New_PictureLeft
PropertyChanged "PictureLeft"
If PictureRight() = LoadPicture("") Then '<== HERE is
' my problem
Set PictureRight = PictureLeft
PropertyChanged "PictureRight"
End If
End Property
Thanks for any help.
Michel Jr.
[Edited by Michel Jr on 05-05-2000 at 07:00 AM]
-
May 4th, 2000, 06:26 PM
#2
Member
I got the solution
If a picturebox or picture object contains a picture the then picture property contains a non zero value.
if picture property = 0 means there is no picture.
Now the modified code look like this
Public Property Set PictureRight(ByVal New_PictureRight As
Picture)
Set m_PictureRight = New_PictureRight
PropertyChanged "PictureRight"
End Property
Public Property Set PictureLeft(ByVal New_PictureLeft As
Picture)
Set m_PictureLeft = New_PictureLeft
PropertyChanged "PictureLeft"
If PictureRight.picture=0 Then '<== HERE is the solution
Set PictureRight = PictureLeft
PropertyChanged "PictureRight"
End If
End Property
-
May 4th, 2000, 07:44 PM
#3
Use the Nothing keyword.
Code:
If PictureRight Is Nothing Then
'the rest of the code
End If
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|