How do you use and If statement with the ZOrder of an object
I am trying to do something like this-
EX:If Image1.ZOrder = 0 Then Msgbox "New"
Printable View
How do you use and If statement with the ZOrder of an object
I am trying to do something like this-
EX:If Image1.ZOrder = 0 Then Msgbox "New"
You can't do that.
WHat is it you're trying to do?
WOka
on 1 form i have two pictures, one is behind the other, then when the user clicks a command button, another form comes up, and on form load i am trying to say - if image1 is on top then message box "image1" if image two is on top then message box "image2"
Try the Visible property.
The visible property wouldn't tell you if img1 was on top of img2
You could use a public variable as a flag.
Maybe some thing like ...
VB Code:
'(in frm1) Public g_bHotImage(1) as boolean Private Sub img1_Click() 'Put something like this in the click events for the image's 'or where every the ZOrder of the images gets changed g_bHotImage(1) = true g_bHotImage(0) = false End Sub '(in frm2) Private Sub frm2_Load() if frm1.g_bHotImage(0) then 'do something else 'do something else end if End Sub