Results 1 to 6 of 6

Thread: Save before close?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    3

    Save before close?

    I've created a save function that checks to see if changes have been made when you select exit from the menu. My only problem is that I'm really new to VB and I'm not sure how to use this function with the toolbar close (X) as well. If anyone could help me out I'd appreciate it. Thanks for your time.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Call the Save function from the form's Closing event.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    3
    Since I'm a noob, how do I declare the closing event?

  4. #4
    Member
    Join Date
    Apr 2004
    Posts
    44
    Code:
        Private Sub form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    
    <your code here>
    
        End Sub
    That should do it

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    Don't worry you don't have to remember all that.

    Go to the form designer, double click the form area and then when the code comes up, use the right-hand-side combobox to select the closing event, then the code in inserted for you.
    I don't live here any more.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    3
    Thankyou for your help. It's appreciated.

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