Results 1 to 6 of 6

Thread: [2005]form_close method?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    [2005]form_close method?

    Hello again. I have a problem. I have a program that has a form that uses the arrow keys to move an image box. Then I have a timer function that checks to see where the image box is. If the image box that you move is inside another image box then it hides the form(frm1) and shows another form (frm2). Now that you have the background, my problem is when i try to close frm2 it reopens itself because the image is still in the other picture box even though you can't see it. that is why I am wondering if there is a form_close function or some way to make something like it? Thank you in advance.
    Last edited by bagstoper; Sep 20th, 2007 at 03:28 PM.

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005]form_close method?

    How do you open form2? On the timer.tick event?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    Re: [2005]form_close method?

    Yes the exact code is...

    Code:
    If player.Left >= PictureBox1.Left And player.Left <= PictureBox1.Left + PictureBox1.Width - player.Width And player.Top >= PictureBox1.Top And player.Top >= PictureBox1.Top + PictureBox1.Height - player.Height Then
                frm_inn.Show()
                Me.Hide()
            End If

  4. #4
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: [2005]form_close method?

    i don't know what's the point...

    but to solve this you have at least two options:
    - you can move the picture box in the form1 to another position....
    - you can stop the timer

    As i said, i don't know what's the point...
    If you can give some more details.

  5. #5
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: [2005]form_close method?

    By the way, you want to return to form1 or close the application?

    And yes there's a form_closing method. You can put there all the actions, that you need to be performed when you close the form.
    Last edited by mickey_pt; Sep 20th, 2007 at 07:30 PM. Reason: Add info

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    Re: [2005]form_close method?

    umm i am making a RPG game and so far you move a dot on the screen with the arrow key and if the image is inside the second one the it shows the for that goes with that image. like if there was a picture of an inn on the form and you moved the image into it the it will show frm_inn and so on. and thank you for your help i cant believe i didnt think of that.

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