Console in VB.NET "X" button handler


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Console in VB.NET "X" button handler

  1. #1
    Join Date
    Feb 2007
    Posts
    49

    Exclamation Console in VB.NET "X" button handler

    I am writing a stupid console app just to see how it works. I can not figure out how to create a handler for the close button. I want to stop loops and close othe running apps when the "X" button is clicked on the console. I have searched around and can't find anything that looks like it will work. Please Help.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Console apps are not event-driven, so there's no way to create a handler. When the console window is closed, the app is terminated and your loops, etc. will stop automatically.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Feb 2007
    Posts
    49
    ok, thank you.
    I wanted to close the COM port before it exited, but oh well.

Similar Threads

  1. Replies: 12
    Last Post: 03-09-2010, 10:51 AM
  2. Replies: 1
    Last Post: 01-10-2007, 11:55 AM
  3. vb.net and game console
    By Mischa in forum .NET
    Replies: 0
    Last Post: 12-15-2006, 07:39 AM
  4. An unusal issue with SPIN BUTTON
    By vipin_pc in forum VB Classic
    Replies: 8
    Last Post: 11-17-2006, 03:22 PM
  5. VB.NET: 3 points of view
    By David Kroll in forum .NET
    Replies: 33
    Last Post: 02-13-2001, 11:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center