hide() problem

Joined
Jan 5, 2009
Messages
8
Programming Experience
Beginner
Hi, I have the following codes:

VB.NET:
me.hide()
staff.show()

It run smoothly for the first time,but when I execute it for the second time,it occured the following errors:

Unable to copy file "obj\Debug\FYP.exe" to "bin\Debug\FYP.exe". The process cannot access the file 'bin\Debug\FYP.exe' because it is being used by another process.


May I know what is the problem???
 
Me.Hide hides your startup form MemberLogin, your application setting is "Shutdown mode: when startup form closes". So when your startup form is never closed your app never shuts down.

You should set your main form as startup form (MemberEdit form?). In application Startup event you can show the login form modally (ShowDialog) and cancel the app startup if login doesn't succeed (e.Cancel). If login does succeed the Startup event would proceed as normal and your main form opens.
 
Back
Top