I create vb.net application and i add one windows form,called frmScan.
i put two textboxes and two labels. Then i write the following
thread with delegate event.
Private Delegate Sub DoInitializedDelegate() Public motdet As New Thread(AddressOf MotionDetection) Private Sub MotionDetection() 'Do motion detection Work 'It is never ending Loop until form unload. End Sub
Then I start it in my form load event.
Private Sub frmScan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load motdet.Start() End Sub
So my problem started when i load the form.
i can see the form but it is like loading something.
i thought my motion detecting thread is never ending loop until form unload.
i cannot type anything inside two text box i mentions in above.
how should i do ? pls help me.
thanks
best rgds,
df
VulpesPosted Aug 28, 2012, 6:46 AM
Rather than use the Load event, I'd try placing the code which starts the new thread in the Form's Shown event handler. This event won't be fired until the form has loaded and is displayed for the first time. It won't fire again after that.