Results 1 to 4 of 4

Thread: [RESOLVED] Form Closing event

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Resolved [RESOLVED] Form Closing event

    I read about this Form.Closing event from MSDN. So I created 2 forms, 1 parent and one MDI child. In the child form, I tried to create the following routine, but 'Closing' is not even an option in MyBase! What is the problem?!

    Thanks!

    VB Code:
    1. Private Sub Form2_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    2.     End Sub 'Form1_Closing

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Form Closing event

    If you're using VB 2005 then you should use the FormClosing event. The Closing event is obsolete in .NET 2.0, which is why it doesn't show up in Intellisense. You shouldn't be typing event handlers directly anyway. You should sue the drop-down lists at the top of the code window or else use the Properties window to generate event handler signatures. Can you please specify your version when posting in future?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Re: Form Closing event

    Solved. My version of the VB.NET is FormClosing

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Re: Form Closing event

    Thanks JIM. You are right. I am using 2005.

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