Results 1 to 6 of 6

Thread: UnloadMode

  1. #1

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    UnloadMode

    This question has been asked before, but I haven't yet found an answer.

    I wish to test to see if the form I have is closing because the "X" button has been clicked.

    I know I need to put code in the fomr_Closing event,
    and I know I can cancel the close using "e.Cancel = True"

    However, I only wish to do this if the form is closing due to the"X" and not the numerous other reasons a form could be closing.

    Any ideas?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474

  3. #3

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    Thanks.
    I wonder why they felt unloadmode should be removed...

  4. #4

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    ok, I tried that code and every time I test the return string is "RunDialog" whether I cause the close in code (me.close) or press the "x"...

    The form being displayed is being shown modally (ShowDialog) -

  5. #5
    Junior Member
    Join Date
    Apr 2001
    Location
    New Zealand
    Posts
    20
    Sorry was thinking of vb6

  6. #6
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    And that works in VB.NET???

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