I have a modual that uses a sub main, and creates my main form. loads just fine.
Now the main form calls the mod and does stuff (alot of stuff). Now the problem is my form freezes up until the processes are complete is there a way to prevent this from happing? In vb 6 there was doevents() which is not the same in .net. I have tried using threads but that is not working either. code sample for threads.
'these functions are on my main form
Private Sub doStuff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles doStuff.Click
Dim t As System.Threading.Thread
t = New System.Threading.Thread(AddressOf Me.startBackGround)
Dim first As Boolean = False
While OutFile() 'this calls a function in my MOD that checks a directory. this function looks to see if it's empty ifnot it will call a function do process the data.
tmrCreatePackage.Enabled = False
If first = False Then
first = True
t.Start()
End If
End While
t.Suspend()
first = False
tmrCreatePackage.Enabled = True
End Sub
Private Sub startBackGround()
SyncLock PrepareFile() 'process the files in the dir.
End SyncLock
End Sub
comments?
this is a quick update from vb 6 to .net thus the mods and not classes.
--------------

Now the main form calls the mod and does stuff (alot of stuff). Now the problem is my form freezes up until the processes are complete is there a way to prevent this from happing? In vb 6 there was doevents() which is not the same in .net. I have tried using threads but that is not working either. code sample for threads.
'these functions are on my main form
Private Sub doStuff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles doStuff.Click
Dim t As System.Threading.Thread
t = New System.Threading.Thread(AddressOf Me.startBackGround)
Dim first As Boolean = False
While OutFile() 'this calls a function in my MOD that checks a directory. this function looks to see if it's empty ifnot it will call a function do process the data.
tmrCreatePackage.Enabled = False
If first = False Then
first = True
t.Start()
End If
End While
t.Suspend()
first = False
tmrCreatePackage.Enabled = True
End Sub
Private Sub startBackGround()
SyncLock PrepareFile() 'process the files in the dir.
End SyncLock
End Sub
comments?
this is a quick update from vb 6 to .net thus the mods and not classes.
--------------