exit vb6.0

command button to exit from vb application

Page 1 of 1

6 Replies - 17246 Views - Last Post: 10 July 2008 - 09:58 AM Rate Topic: -----

#1 bonzo0  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 08

exit vb6.0

Post icon  Posted 09 July 2008 - 06:44 AM

hello...i want to exit completely from vb application upon clicking a command button that i will create... please post the codes.
thanx in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: exit vb6.0

#2 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1382
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: exit vb6.0

Posted 09 July 2008 - 06:50 AM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: exit vb6.0

Posted 09 July 2008 - 09:24 PM

I know of one, simple, little, 3 letter, word that, if put in your Command_Click event, will close your application. Ready, drum roll please...
End


Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: exit vb6.0

Posted 09 July 2008 - 09:28 PM

First, here is a snippet showing how to accomplish this the right way.

@jacobjordan: Using End is the worst way to accomplish this, End basically crashes your application without throwing any error messages
Was This Post Helpful? 1

#5 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: exit vb6.0

Posted 10 July 2008 - 12:51 AM

Psycho is right.
Even for Single-form programs, you should unload the form instead of using End.

The End statement abruptly quits the application but it does not invoke the Unload, QueryUnload, Terminate event, or other custom events or functions and hence will not be executed.

Although End closes files opened with the Open Statement and frees all memory resources used by your program, you should avoid using the End Statement for the reason mentioned above.
Was This Post Helpful? 0
  • +
  • -

#6 vikranta1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-March 08

Re: exit vb6.0

Posted 10 July 2008 - 01:24 AM

Put Command Button in a Form and On Click Event of CommandButton

Private sub Command1_Click()
 'Quiting From Application   
  End
End Sub

Put Command Button in a Form and On Click Event of CommandButton

[code]
Private sub Command1_Click()
'Quiting From Application 
End
End Sub 


Was This Post Helpful? 0
  • +
  • -

#7 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: exit vb6.0

Posted 10 July 2008 - 09:58 AM

View Postvikranta1, on 10 Jul, 2008 - 03:24 AM, said:

Put Command Button in a Form and On Click Event of CommandButton

Private sub Command1_Click()
 'Quiting From Application   
  End
End Sub

Put Command Button in a Form and On Click Event of CommandButton

[code]
Private sub Command1_Click()
'Quiting From Application 
End
End Sub 


Have you even read the other 4 replies to this thread???
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1