Click here to Skip to main content
15,891,253 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSetting Primary Display Pin
Jayme6518-Jan-16 23:33
Jayme6518-Jan-16 23:33 
AnswerRe: Setting Primary Display Pin
Richard Andrew x6419-Jan-16 4:39
professionalRichard Andrew x6419-Jan-16 4:39 
GeneralRe: Setting Primary Display Pin
Jayme6519-Jan-16 6:46
Jayme6519-Jan-16 6:46 
GeneralRe: Setting Primary Display Pin
Richard Andrew x6419-Jan-16 8:05
professionalRichard Andrew x6419-Jan-16 8:05 
QuestionThread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx14-Jan-16 7:49
professionaljkirkerx14-Jan-16 7:49 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Sascha Lefèvre14-Jan-16 8:10
professionalSascha Lefèvre14-Jan-16 8:10 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx14-Jan-16 8:33
professionaljkirkerx14-Jan-16 8:33 
AnswerRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Sascha Lefèvre14-Jan-16 9:40
professionalSascha Lefèvre14-Jan-16 9:40 
That code is using a whole thread just for the purpose of starting another thread at regular intervals and otherwise sleeping. That's awful. You could basically replace it with the code sample from the Timer Class (System.Threading)[^].

If you got a working code without threading I would use that. If it looks sloppy (like you said) I would suggest trying to improve it without introducing unnecessary parallelism. If you want to do something with Tasks/Threads in order to learn about it I would try to find some project that actually calls for it.

And I would suggest using Tasks instead of Threads: Tasks can do the same thing but better/in a more convenient way in 99% of all cases. Take a look at Sacha Barber's articles on the TPL if you haven't already: Task Parallel Library: 1 of n[^]
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx14-Jan-16 11:06
professionaljkirkerx14-Jan-16 11:06 
AnswerRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Wombaticus15-Jan-16 0:05
Wombaticus15-Jan-16 0:05 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx15-Jan-16 6:06
professionaljkirkerx15-Jan-16 6:06 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Wombaticus15-Jan-16 6:19
Wombaticus15-Jan-16 6:19 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx15-Jan-16 7:13
professionaljkirkerx15-Jan-16 7:13 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Wombaticus15-Jan-16 7:38
Wombaticus15-Jan-16 7:38 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx15-Jan-16 9:00
professionaljkirkerx15-Jan-16 9:00 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
Wombaticus16-Jan-16 7:22
Wombaticus16-Jan-16 7:22 
GeneralRe: Thread vs Task, seeking advice before I write code, design point of view. Pin
jkirkerx17-Jan-16 6:59
professionaljkirkerx17-Jan-16 6:59 
QuestionHow to alert checked items from checkedlistbox Pin
Daniel Elmnas11-Jan-16 2:46
Daniel Elmnas11-Jan-16 2:46 
AnswerRe: How to alert checked items from checkedlistbox Pin
Richard Deeming11-Jan-16 3:57
mveRichard Deeming11-Jan-16 3:57 
QuestionWindows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
jkirkerx9-Jan-16 13:29
professionaljkirkerx9-Jan-16 13:29 
AnswerRe: Windows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
Dave Kreskowiak9-Jan-16 18:17
mveDave Kreskowiak9-Jan-16 18:17 
GeneralRe: Windows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
jkirkerx10-Jan-16 7:33
professionaljkirkerx10-Jan-16 7:33 
GeneralRe: Windows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
Dave Kreskowiak10-Jan-16 7:41
mveDave Kreskowiak10-Jan-16 7:41 
GeneralRe: Windows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
jkirkerx10-Jan-16 9:40
professionaljkirkerx10-Jan-16 9:40 
AnswerRe: Windows service and a Form program, serializing data stored in a file, shared between the 2 programs Pin
Eddy Vluggen10-Jan-16 4:51
professionalEddy Vluggen10-Jan-16 4:51 

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.