Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: CLosing threads Pin
Adam Goossens30-Dec-04 13:03
Adam Goossens30-Dec-04 13:03 
GeneralThread and Not Responding Pin
brunoconde29-Dec-04 9:48
brunoconde29-Dec-04 9:48 
GeneralRe: Thread and Not Responding Pin
Tom Larsen29-Dec-04 10:49
Tom Larsen29-Dec-04 10:49 
GeneralRe: Thread and Not Responding Pin
Heath Stewart29-Dec-04 11:23
protectorHeath Stewart29-Dec-04 11:23 
GeneralRe: Thread and Not Responding Pin
Tom Larsen30-Dec-04 4:29
Tom Larsen30-Dec-04 4:29 
GeneralRe: Thread and Not Responding Pin
Heath Stewart30-Dec-04 5:17
protectorHeath Stewart30-Dec-04 5:17 
GeneralRe: Thread and Not Responding Pin
Heath Stewart29-Dec-04 11:06
protectorHeath Stewart29-Dec-04 11:06 
GeneralRe: Thread and Not Responding Pin
PaleyX1-Apr-05 2:50
PaleyX1-Apr-05 2:50 
When I set Cursor.Current to the WaitCursor then start a thread to do a long process the Cursor doesn't remain as the WaitCursor it almost immediately changes back to the default cursor.

My long process fires an event to say it has started and I handle that on the GUI thread (yes I am using invoke required and delegates) - this sets the Cursor.Current to the WaitCursor then when the long process has completed it fires another event which is handled on the GUI thread which sets the Cursor.Current to the default cursor. I would like the Cursor to remain as the WaitCursor until the long process has completed but no amount of jiggery pokery seems to enable me to do that - I have had to resort to disabling huge amounts of the GUI so the user can't mess up - a WaitCursor would be nice but it just isn't happening.

I know the following is in VB but I haven't had much joy on the VB forum.

The long running process fires off an event every 1000 records or so which is handled on the GU thread thus:

Private Delegate Sub xxxDelegate(ByVal sender As Object, ByVal e As xxxEventArgs)<br />
<br />
Private Sub xxx(ByVal sender As Object, ByVal e As xxxEventArgs) Handles LongProcess.xxx<br />
<br />
If button.InvokeRequired = False Then<br />
Console.WriteLine("A - " & Cursor.Current.ToString())<br />
...<br />
Else<br />
Console.WriteLine("B - " & Cursor.Current.ToString())<br />
Dim del As New xxxDelegate(AddressOf xxx)<br />
Me.BeginInvoke(del, New Object() {sender, e})<br />
End If<br />
End Sub



When run the following is written to the console:

B - [Cursor: WaitCursor]
A - [Cursor: Default]
B - [Cursor: WaitCursor]
A - [Cursor: Default]
B - [Cursor: WaitCursor]
A - [Cursor: Default]
GeneralRe: Thread and Not Responding Pin
Heath Stewart1-Apr-05 7:03
protectorHeath Stewart1-Apr-05 7:03 
GeneralRe: Thread and Not Responding Pin
PaleyX1-Apr-05 7:17
PaleyX1-Apr-05 7:17 
GeneralRe: Thread and Not Responding Pin
Heath Stewart2-Apr-05 1:25
protectorHeath Stewart2-Apr-05 1:25 
GeneralRe: Thread and Not Responding Pin
PaleyX2-Apr-05 1:53
PaleyX2-Apr-05 1:53 
GeneralRe: Thread and Not Responding Pin
Heath Stewart3-Apr-05 6:41
protectorHeath Stewart3-Apr-05 6:41 
GeneralRe: Thread and Not Responding Pin
PaleyX4-Apr-05 5:37
PaleyX4-Apr-05 5:37 
GeneralRe: Thread and Not Responding Pin
Heath Stewart4-Apr-05 8:23
protectorHeath Stewart4-Apr-05 8:23 
GeneralRe: Thread and Not Responding Pin
Ashar Khaliq29-Dec-04 11:17
Ashar Khaliq29-Dec-04 11:17 
GeneralRe: Thread and Not Responding Pin
brunoconde30-Dec-04 2:47
brunoconde30-Dec-04 2:47 
GeneralRe: Thread and Not Responding Pin
Heath Stewart30-Dec-04 5:14
protectorHeath Stewart30-Dec-04 5:14 
GeneralTAPI Programming in C# Pin
SyedMazharAli29-Dec-04 9:27
SyedMazharAli29-Dec-04 9:27 
GeneralRe: TAPI Programming in C# Pin
Michael P Butler29-Dec-04 10:10
Michael P Butler29-Dec-04 10:10 
GeneralRe: TAPI Programming in C# Pin
Ray Cassick29-Dec-04 10:14
Ray Cassick29-Dec-04 10:14 
GeneralRe: TAPI Programming in C# Pin
Ray Cassick29-Dec-04 10:11
Ray Cassick29-Dec-04 10:11 
GeneralRe: TAPI Programming in C# Pin
SyedMazharAli29-Dec-04 10:38
SyedMazharAli29-Dec-04 10:38 
GeneralMany to many relationships Pin
wlowerycolumbus29-Dec-04 7:03
professionalwlowerycolumbus29-Dec-04 7:03 
GeneralRe: Many to many relationships Pin
Javier Lozano29-Dec-04 7:20
Javier Lozano29-Dec-04 7:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.