Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: ZOrder and If Statements

104| Mon, 03 Dec 2007 10:37:00 GMT| streaksathlete| Comments (4)
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"

Keywords & Tags: zorder, statements, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560832/
 
«« Prev - Next »» 4 helpful answers below.
You can't do that.
WHat is it you're trying to do?

WOka

wokawidget | Mon, 03 Dec 2007 18:59:00 GMT |

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"

streaksathlete | Mon, 03 Dec 2007 19:00:00 GMT |

Try the Visible property.

martinliss | Mon, 03 Dec 2007 19:01:00 GMT |

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 ...

'(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

longwolf | Mon, 03 Dec 2007 19:03:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories