| | |
menus freezing at runtime
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 6
Reputation:
Solved Threads: 0
Hi
I am working on a pocket pc application. I am displaying text as one word at a time on the screen with a delay of 240ms. But the problem is as soon the the text starts running on the screen ,, i cant access any menu functions. It is possibly something to with the threads but what it is actually i cant figure it out. Any ideas would be much appreciated.
Thanks in advance.
Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
Try
Dim t1 As New Thread(AddressOf th1)
t1.Start()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Public Sub th1()
Me.BeginInvoke(New InvokeDelegate(AddressOf txt))
End Sub
Public Sub txt()
Dim readcontents As String
readcontents = TextBox1.Text
textdelimiter = (" ")
Dim splitout() As String = Split(readcontents, textdelimiter)
Dim i As Integer
For i = 0 To UBound(splitout)
Label1.Text = splitout(i)
Label1.Refresh()
System.Threading.Thread.Sleep(240)
Next
End Sub
I am working on a pocket pc application. I am displaying text as one word at a time on the screen with a delay of 240ms. But the problem is as soon the the text starts running on the screen ,, i cant access any menu functions. It is possibly something to with the threads but what it is actually i cant figure it out. Any ideas would be much appreciated.
Thanks in advance.
Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
Try
Dim t1 As New Thread(AddressOf th1)
t1.Start()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Public Sub th1()
Me.BeginInvoke(New InvokeDelegate(AddressOf txt))
End Sub
Public Sub txt()
Dim readcontents As String
readcontents = TextBox1.Text
textdelimiter = (" ")
Dim splitout() As String = Split(readcontents, textdelimiter)
Dim i As Integer
For i = 0 To UBound(splitout)
Label1.Text = splitout(i)
Label1.Refresh()
System.Threading.Thread.Sleep(240)
Next
End Sub
I don't do PocketPC programming but I think
System.Threading.Thread.Sleep(240) makes your "main" thread to sleep instead of "current" thread. As you can see, I'm not that familiar with threading either
Teme64 @ Windows Developer Blog
•
•
Join Date: Nov 2008
Posts: 6
Reputation:
Solved Threads: 0
Thanks for your reply.
The format that i am using for sleep method is for the current thread i have checked that. Interestingly the same code works well for desktop pc. I am really a beginner and threading methods for pocket pc are very different (limited) than desktop pc.
But i need to get this going...
Cheers
The format that i am using for sleep method is for the current thread i have checked that. Interestingly the same code works well for desktop pc. I am really a beginner and threading methods for pocket pc are very different (limited) than desktop pc.
But i need to get this going...
Cheers
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: file copying itself
- Next Thread: scrollbar control that is changing its colour
Views: 372 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database databasesearch datagrid datagridview design designer dissertation dissertations dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy highlighting images inline insert installer intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting studio syntax table tcp text textbox time timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





