H
hakan aktan
Hi all,
I have 2 wince forms and fisrst form causes second to launh.While some
process is running on first
I need second form to have a hard process too. I tried thread, timer and
while , they did not work.
The forms are being locked after a few seconds.Is there another way ,i need
anything that works multi processes on multiform.
Here is my code: (Wince 4.2 OS , Coding VB.Net 2003 on CF 1.1)
Thanx in advance
Form1:
'--------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2
frm2.Show()
'This job has to work until main Form1 is closed
While (True)
Application.DoEvents()
System.Threading.Thread.Sleep(1000)
'Do stg
End While
'Form2 Code
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim th As Thread
th = New Thread(AddressOf mySub)
th.Start()
End Sub
Private Sub mySub()
While(MoveForward)
Application.DoEvents()
System.Threading.Thread.Sleep(300)
'Do stg
Next
End Sub
I have 2 wince forms and fisrst form causes second to launh.While some
process is running on first
I need second form to have a hard process too. I tried thread, timer and
while , they did not work.
The forms are being locked after a few seconds.Is there another way ,i need
anything that works multi processes on multiform.
Here is my code: (Wince 4.2 OS , Coding VB.Net 2003 on CF 1.1)
Thanx in advance
Form1:
'--------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2
frm2.Show()
'This job has to work until main Form1 is closed
While (True)
Application.DoEvents()
System.Threading.Thread.Sleep(1000)
'Do stg
End While
'Form2 Code
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim th As Thread
th = New Thread(AddressOf mySub)
th.Start()
End Sub
Private Sub mySub()
While(MoveForward)
Application.DoEvents()
System.Threading.Thread.Sleep(300)
'Do stg
Next
End Sub