Click here to Skip to main content
15,899,679 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: WaitCursor, again Pin
lukeer16-Jan-12 12:15
lukeer16-Jan-12 12:15 
GeneralRe: WaitCursor, again Pin
MikeTheFid18-Jan-12 9:16
MikeTheFid18-Jan-12 9:16 
Questionadjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
BillWoodruff4-Sep-11 15:31
professionalBillWoodruff4-Sep-11 15:31 
AnswerRe: adjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
Mehdi Gholam5-Sep-11 19:58
Mehdi Gholam5-Sep-11 19:58 
GeneralRe: adjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
BillWoodruff7-Sep-11 5:02
professionalBillWoodruff7-Sep-11 5:02 
GeneralRe: adjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
Mehdi Gholam7-Sep-11 5:09
Mehdi Gholam7-Sep-11 5:09 
AnswerRe: adjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
Mehdi Gholam11-Sep-11 20:49
Mehdi Gholam11-Sep-11 20:49 
GeneralRe: adjusting for differences in TitleBar and window border size in Win 7 with some Windows Effects turned on ? Pin
BillWoodruff12-Sep-11 1:58
professionalBillWoodruff12-Sep-11 1:58 
QuestionGet rid of WaitCursor Pin
lukeer1-Sep-11 21:22
lukeer1-Sep-11 21:22 
AnswerRe: Get rid of WaitCursor Pin
BillWoodruff2-Sep-11 2:37
professionalBillWoodruff2-Sep-11 2:37 
AnswerRe: Get rid of WaitCursor PinPopular
Luc Pattyn2-Sep-11 3:18
sitebuilderLuc Pattyn2-Sep-11 3:18 
GeneralRe: Get rid of WaitCursor Pin
Dave Kreskowiak2-Sep-11 4:16
mveDave Kreskowiak2-Sep-11 4:16 
AnswerRe: Get rid of WaitCursor Pin
Luc Pattyn2-Sep-11 4:28
sitebuilderLuc Pattyn2-Sep-11 4:28 
GeneralRe: Get rid of WaitCursor Pin
BillWoodruff2-Sep-11 5:18
professionalBillWoodruff2-Sep-11 5:18 
AnswerRe: Get rid of WaitCursor Pin
Luc Pattyn2-Sep-11 5:39
sitebuilderLuc Pattyn2-Sep-11 5:39 
GeneralRe: Get rid of WaitCursor Pin
BillWoodruff2-Sep-11 19:08
professionalBillWoodruff2-Sep-11 19:08 
Hi Luc,

First, I truly appreciate the time you took to comment further on this technique: I am already 'socialized' to wrapping things like 'StreamReaders' and such in 'Using' statements.

However, in this case, a simple need to change a cursor back to its default visual state, imho using a technique which involves creating a class seems to me like shooting a horsefly with a cannon Smile | :)

What's happening here is just another 'quirk' of Windows Forms: the need to set focus somewhere to 'provoke' the cursor to change visual state properly. A quirk I cannot even reproduce reliably (see example below).

Is it possible that I am 'off the planet' here, and you are talking about a DataBase cursor ... I hope not Smile | :)

In addition, if I understand it correctly, a class to be used in this pattern of Using/Dispose must inherit from IDisposable, a key fact, omitted here, the 'newbie' to .NET may not "get" too easily.

In VS Studio Pro 2010, compiling against .NET FrameWork 4.0 Client Profile, the following code in a button click handler:
C#
using System.Threading;            

private void button2_Click(object sender, EventArgs e)
{
  button2.Cursor = Cursors.WaitCursor;
  Thread.Sleep(10000);
  button2.Cursor = Cursors.Default;
}
Does reset the cursor properly after the call to the Thread.Sleep.

The "big picture," I am sure we both agree on is: any operation causing a noticeable delay should be handled by threading, so the UI stays responsive.

I look forward to further enlightenment !

best, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables

GeneralRe: Get rid of WaitCursor Pin
Luc Pattyn3-Sep-11 2:11
sitebuilderLuc Pattyn3-Sep-11 2:11 
GeneralRe: Get rid of WaitCursor Pin
GParkings3-Sep-11 12:20
GParkings3-Sep-11 12:20 
GeneralRe: Get rid of WaitCursor Pin
Eddy Vluggen3-Sep-11 13:15
professionalEddy Vluggen3-Sep-11 13:15 
GeneralRe: Get rid of WaitCursor Pin
Luc Pattyn3-Sep-11 13:36
sitebuilderLuc Pattyn3-Sep-11 13:36 
GeneralRe: Get rid of WaitCursor Pin
Eddy Vluggen3-Sep-11 22:43
professionalEddy Vluggen3-Sep-11 22:43 
GeneralRe: Get rid of WaitCursor Pin
BillWoodruff3-Sep-11 19:19
professionalBillWoodruff3-Sep-11 19:19 
GeneralRe: Get rid of WaitCursor Pin
Luc Pattyn4-Sep-11 2:42
sitebuilderLuc Pattyn4-Sep-11 2:42 
GeneralRe: Get rid of WaitCursor Pin
BillWoodruff4-Sep-11 14:21
professionalBillWoodruff4-Sep-11 14:21 
GeneralRe: Get rid of WaitCursor Pin
Luc Pattyn4-Sep-11 14:42
sitebuilderLuc Pattyn4-Sep-11 14:42 

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.