# Visual Basic > Games and Graphics Programming > Game Demos >  VB6 BlackJack

## Cruncher

K i made a near fully functioning blackjack excluding only the split.

i would like to give a HUGE shoutout to techorobbo, he helped me with a lot of coding evident by this thread 

anywhere heres the attached ment, tell me what you think

EDIT: link reuploaded, there was an issue with the application not actually closing that has been resolved

----------


## ngreenwood6

I just tried this and after I quit the game blackjack.exe was still running. You may want to look into this.

----------


## Cruncher

I noticed that, do you know how thats fixable? do i need to put a button that actually runs the end command? i beleive the standard windows "x" should do the job :S

----------


## ngreenwood6

Is that form your main form?

----------


## Cruncher

i have 4 forms dialog dialog 2 dialog 3 and Form1(the main form where blackjack is played)

----------


## ngreenwood6

hmmm. if that is the main application form then it should be exiting. One way you may be able to fix it is by adding:



```
Application.Exit();
```

to the forms closing or closed event.

----------


## GaryMazzone

Please do not inclide exe files in you upload.

----------


## technorobbo

If you have multiple forms the app wont end until all forms are unloaded. A hidden form is not unloaded so specifically unload the form. 
example


```
Unload me
```

----------


## si_the_geek

> do i need to put a button that actually runs the end command? i beleive the standard windows "x" should do the job :S


The "X" just tells that particular form to unload, what else happens is up to you.

There are a couple of articles about this in our Classic VB FAQs _(in the FAQ forum, which is shown near the top of our home page)_.

First off, there is Why is using the 'End' statement (or VB's "stop" button) a bad idea?

Then for an explanation (and example code) for how you should be closing a form/program, see the article How should I close my form/program/class?

----------


## technorobbo

Cruncher,
Put this code in your Blackjack.frm and it should fix it up 


```
Private Sub Form_Unload(Cancel As Integer)
Dim f As Form
For Each f In Forms
Unload f
Next
End Sub
```

----------


## Cruncher

Fixed, thanks

----------

