Results 1 to 5 of 5

Thread: [02/03] Other way to Close Form

  1. #1

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    [02/03] Other way to Close Form

    Hi All,

    I found another way to close Form with several buttons.
    Here's the Code:

    VB Code:
    1. Private Sub CloseForm(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCancel.Click, cmdOK.Click
    2.         End
    3.     End Sub

    Could be helpfull.
    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  2. #2
    Lively Member
    Join Date
    Jan 2006
    Posts
    114

    Re: [02/03] Other way to Close Form

    works in 2005 also

  3. #3

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [02/03] Other way to Close Form

    Quote Originally Posted by [anarchy]
    works in 2005 also
    Thanks for your reply.
    I was just testing it in the VB 2005 Express Edition and it's working to, like you said.

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

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

    Re: [02/03] Other way to Close Form

    Gadzooks! Have you read the help topic for the End statement? It's pretty much akin to using End Process in the Task Manager. Bad, bad, bad!
    Note The End statement stops code execution abruptly, without invoking the Finalize method or any other Visual Basic code. Object references held by other programs are invalidated.
    If your application has any forms open, you should close them before executing End.
    As you see, End is not a way to "close" forms.
    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

  5. #5

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [02/03] Other way to Close Form

    Quote Originally Posted by jmcilhinney
    Gadzooks! Have you read the help topic for the End statement? It's pretty much akin to using End Process in the Task Manager. Bad, bad, bad!As you see, End is not a way to "close" forms.
    Hi jm,

    Yes I've readed the topic for the End statement and I've searched this forum but, I've readed MCAD/MCSD also and there I found this other solution.

    I quote:

    Add code to the procedure to close the application. This is simple the End statement. With the code example written like the one in my first post.

    I think you can understand now that I thought (MCAD/MCSD is to get a certified application and solution developer) it was another and GOOD way of closing a Form.

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

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