question on form

dec21st

Active member
Joined
May 14, 2005
Messages
43
Programming Experience
3-5
i have a problem here

i'm not sure on how to show forms

issue 1
if i use
VB.NET:
form.showdialog()
me.close()
the app will still be in my taskbar
when i open a few forms... the program won't close properly

issue 2
if i use
VB.NET:
form.show()
me.hide()
i will still have my files runnin in the background... is this true?



usually how apps form are open and close so that it doesn't run in the background?
 
The program will end after the last loaded form is unloaded from memory. However, the recommended way to end your application is by using Application.Exit.

Also, you can't just show a form like in VB6. You have to create an instance of the form and show that:

Dim frmMyForm as New Form1
frmMyForm.Show
 
BankCop said:
The program will end after the last loaded form is unloaded from memory. However, the recommended way to end your application is by using Application.Exit.

though Application.Exit() does brute-force the application to exit and release the resources it's better practice to either

A.) let the Sub Main procedure reach the End Sub line (this exits the application)

B.) on the base form use Me.Close()


as this way if there is any code to perform some cleanup or to save settings they will get done

Application.Exit() does not let any closing subroutines run, it simply forces the resources to be released... regardless

something to keep in mind
 
Back
Top