When you abort the thread, you kill the message pump that handles the messages that does everything in the GUI. There is nothing that can handle the message that says that the window should be removed.
Generally, using the Abort method is a bad way to stop a thread. The Abort method kills the thread by throwing a ThreadAbortException in it, which can happen anywhere in the thread's code. It's difficult to write code that can cope with that situation in a well behaved manner.
Despite everything, the person most likely to be fooling you next is yourself.
It works fine if i'm doing no loading after the thread start command, but if I add the PopulateTree call (or just a Thread.Sleep()), it gives me a InvalidOperationException (Invoke or BeginInvoke cannot be called on a control until the window handle has been created).
thanks for your information. but i need to hide some default implemntation for eg. checkbox in parent node, for that i have used DrawDefault =false, so i want to draw the plusminus of my own. can you plz share some information regaridng this
You don't have the combo boxes above the code page to access the controls and the methods in the current class . Or am I missing something. This is the most frustrating thing (and square brackets) in the change from VB to C#.
Got my DAL working, half way through the code gen app I had forgotten how much fun it is to be applying something new. I've been here too long, time to move on.
Never underestimate the power of human stupidity