That was a sample code, in real code I want to Make TOpenGLControl and when it will create and I want to set Parent property it takes 500 to 1500ms in debug mode in my machine so I want to make it in a separate thread.
Meaning ? That your application/form takes that amount of time in order to start/show ? And how exactly is using a thread going to help you with that ? Just asking, because i don't see the benefit.
Also I know that is wrong but I thought with myself I can do that in a controlled situation but this behavior seems weird, where is the control? am I wrong?
Yes, you are wrong. There is no weird behaviour there, other then how threads behave/work. You are accessing a variable from another thread and didn't follow the rules.
So the question, becomes again: what are you trying to achieve exactly ? That your form shows up quicker (or application starts quicker) ? Sorry, but you'd have to life with that, because the gl context needs to be initialized and that simply takes time.
However, camouflaging the start-up delay is possible but a simple timer or onidle event is sufficient for that. Just create the gl context where it is least obvious for the user to notice, preferably when the form isn't visible (for the user) at all.