Click here to Skip to main content
15,908,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Salam!
i am using thred to display the progress bar for processing.
have started a thread.
i have started the thread in the LOAD event of the form.then calling s function, At the end of function "END SUB" am aborting the thread.
now i want to close this form but after aborting thread am calling ME.CLOSE but its not working.
how to close the form??
Can any one help??
Posted
Comments
DaveAuld 8-Jun-10 15:55pm    
are you trying to call Me.Close() inside Load() event? if you are that won't work. you need to wait for the load to finish, maybe start a timer, and then call the Close() from the timertick.

Salam!
Thanks for reply.
i am done with the probelm .i am creating the thread in the main thread.and aborting the thread then after aborting the thread will not allow execute another statement.
what i have did is that i have invoke the main thread again and then close the form.
and ITS DONE.

Regards.
 
Share this answer
 
You can stop thread or you can use delegate to avoid cross thread errors. One more option is there in form load event you can set

CheckForIllegalCrossThreadCalls = False

But to set CheckForIllegalCrossThreadCalls = False is not advisable from programming point of view.
 
Share this answer
 
Comments
DaveyM69 9-Jun-10 8:28am    
"not advisable from programming point of view"
What other point of view is there?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900