Results 1 to 5 of 5

Thread: ZOrder and If Statements

  1. #1

    Thread Starter
    Hyperactive Member StreaksAthlete's Avatar
    Join Date
    Sep 2004
    Posts
    348

    Exclamation ZOrder and If Statements

    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"
    Unity Programs™ - Downloads To Make Your Computer Life Easier - UnityPrograms.com, check it out
    My small company, I need feedback.


    If someone's post was useful, don't forget to Rate It by clicking the Rate This Post link under the avatar.
    If this post has been resolved. Please mark it as Resolved by going through the Thread Tools above and clicking on the Mark Thread Resolved option.
    We ride together, We die together, .NET for life. - Working With Visual Studio.NET 2005

    Application Deployment, General Developer Forum, Visual Basic .NET

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member StreaksAthlete's Avatar
    Join Date
    Sep 2004
    Posts
    348

    Re: ZOrder and If Statements

    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"
    Unity Programs™ - Downloads To Make Your Computer Life Easier - UnityPrograms.com, check it out
    My small company, I need feedback.


    If someone's post was useful, don't forget to Rate It by clicking the Rate This Post link under the avatar.
    If this post has been resolved. Please mark it as Resolved by going through the Thread Tools above and clicking on the Mark Thread Resolved option.
    We ride together, We die together, .NET for life. - Working With Visual Studio.NET 2005

    Application Deployment, General Developer Forum, Visual Basic .NET

  4. #4

  5. #5
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: ZOrder and If Statements

    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:
    1. '(in frm1)
    2. Public g_bHotImage(1) as boolean
    3.  
    4.  
    5. Private Sub img1_Click()
    6. 'Put something like this in the click events for the image's
    7. 'or where every the ZOrder of the images gets changed
    8.     g_bHotImage(1) = true
    9.     g_bHotImage(0) = false
    10. End Sub
    11.  
    12.  
    13. '(in frm2)
    14. Private Sub frm2_Load()
    15.     if frm1.g_bHotImage(0) then
    16.         'do something
    17.     else
    18.         'do something else
    19.     end if
    20. End Sub

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