Hi, I have the following codes:

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???

Because the main thread doesn't terminated. You just hide the main form, I think you close application from staff form, right?
so, in its close event add this Application.Exit

I Prefer to Put ( .close() ) instead of ( .hide )

[TEX]me.close()[/TEX]

then see the result ..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.