Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I find the BITMAPINFOHEADER of a image Pin
Henry Minute14-Jun-10 1:16
Henry Minute14-Jun-10 1:16 
QuestionRandomize from array Pin
Socheat.Net10-Jun-10 21:00
Socheat.Net10-Jun-10 21:00 
AnswerRe: Randomize from array Pin
OriginalGriff10-Jun-10 21:46
mveOriginalGriff10-Jun-10 21:46 
GeneralRe: Randomize from array Pin
Socheat.Net10-Jun-10 22:13
Socheat.Net10-Jun-10 22:13 
GeneralRe: Randomize from array Pin
Socheat.Net11-Jun-10 1:03
Socheat.Net11-Jun-10 1:03 
GeneralRe: Randomize from array Pin
OriginalGriff11-Jun-10 1:19
mveOriginalGriff11-Jun-10 1:19 
GeneralRe: Randomize from array Pin
OriginalGriff11-Jun-10 1:20
mveOriginalGriff11-Jun-10 1:20 
AnswerRe: Randomize from array Pin
Luc Pattyn11-Jun-10 1:44
sitebuilderLuc Pattyn11-Jun-10 1:44 
Hi,

your code contains a couple of mistakes against general rules, including:

1. event handlers (such as a Click handler) should execute and be done with in less than say 20 milliseconds; anything that takes longer needs a different approach, maybe a timer (a System.Windows.Forms.Timer is best for GUI related stuff), maybe a separate thread;
2. don't abuse Application.DoEvents(), there are a few situations where its use would be OK, yours isn't one of them.
3. avoid "busy loops", such as your while(run) construct, whenever there is an elegant alternative.

Obeying (1) often makes (2) moot.
Griff's approach is fine.

PS: please use PRE tags when including code snippets.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Randomize from array Pin
harold aptroot11-Jun-10 1:53
harold aptroot11-Jun-10 1:53 
GeneralRe: Randomize from array Pin
Luc Pattyn11-Jun-10 2:11
sitebuilderLuc Pattyn11-Jun-10 2:11 
GeneralRe: Randomize from array Pin
harold aptroot11-Jun-10 2:44
harold aptroot11-Jun-10 2:44 
AnswerRe: Randomize from array Pin
Socheat.Net11-Jun-10 17:19
Socheat.Net11-Jun-10 17:19 
GeneralRe: Randomize from array Pin
OriginalGriff11-Jun-10 22:42
mveOriginalGriff11-Jun-10 22:42 
AnswerRe: Randomize from array Pin
yu-jian27-Jun-10 10:34
yu-jian27-Jun-10 10:34 
QuestionNeed help with crystal reports in VS 2008 [modified] Pin
eduardods10-Jun-10 14:34
eduardods10-Jun-10 14:34 
AnswerRe: Need help with crystal reports in VS 2008 Pin
Richard Andrew x6410-Jun-10 17:29
professionalRichard Andrew x6410-Jun-10 17:29 
GeneralRe: Need help with crystal reports in VS 2008 Pin
eduardods10-Jun-10 17:56
eduardods10-Jun-10 17:56 
GeneralRe: Need help with crystal reports in VS 2008 Pin
Richard Andrew x6410-Jun-10 18:17
professionalRichard Andrew x6410-Jun-10 18:17 
GeneralRe: Need help with crystal reports in VS 2008 Pin
eduardods10-Jun-10 20:02
eduardods10-Jun-10 20:02 
AnswerRe: Need help with crystal reports in VS 2008 Pin
V.10-Jun-10 21:11
professionalV.10-Jun-10 21:11 
AnswerRe: Need help with crystal reports in VS 2008 Pin
Mycroft Holmes11-Jun-10 22:04
professionalMycroft Holmes11-Jun-10 22:04 
QuestionHow to add images to a reportviewer ??? Pin
isaacrc8210-Jun-10 13:33
isaacrc8210-Jun-10 13:33 
Questionpopulating a treeview? Pin
User 251249410-Jun-10 6:05
User 251249410-Jun-10 6:05 
AnswerRe: populating a treeview? Pin
Mycroft Holmes11-Jun-10 22:08
professionalMycroft Holmes11-Jun-10 22:08 
QuestionList<T> Comparison [SOLVED] Pin
Paladin200010-Jun-10 4:58
Paladin200010-Jun-10 4:58 

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.