Click here to Skip to main content
15,886,024 members
Home / Discussions / Windows Forms
   

Windows Forms

 
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 
I set the Form's cursor explicitly, so it looks like:
this.Cursor=Cursors.WaitCursor;
// code that may take some tens or, when unlucky, hundreds of milliseconds
this.Cursor=Cursors.Default;



Of course, the cursor stuff isn't pretty, however you can easily make a disposable object for these purposes, so my code actually looks like:
using(new LP_WaitCursor(this)) {
    // code that may take...
}


where LP_WaitCursor holds a Cursor=Cursors.WaitCursor in its constructor, and a Cursor=Cursors.Default in its Dispose() method.

Side note: If the slow operation is bound to take more time, it should not happen on the main thread (which blocks the GUI), instead it should be another thread (maybe a BackgroundWorker) and then it is:
- either irrelevant to the user, hence no indication;
- or relevant, and then it deserves a progress bar and a cancel button.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

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 
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 
GeneralRe: Get rid of WaitCursor Pin
lukeer4-Sep-11 21:03
lukeer4-Sep-11 21:03 
AnswerRe: Get rid of WaitCursor Pin
Luc Pattyn5-Sep-11 1:29
sitebuilderLuc Pattyn5-Sep-11 1:29 
GeneralRe: Get rid of WaitCursor Pin
MicroVirus5-Sep-11 11:17
MicroVirus5-Sep-11 11:17 

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.