Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: Horizontal ScrollBar does not work in the TextBox control... anymore. Pin
iscript20-Jul-09 3:45
iscript20-Jul-09 3:45 
GeneralRe: Horizontal ScrollBar does not work in the TextBox control... anymore. Pin
PIEBALDconsult20-Jul-09 5:06
mvePIEBALDconsult20-Jul-09 5:06 
GeneralRe: Horizontal ScrollBar does not work in the TextBox control... anymore. Pin
iscript20-Jul-09 5:15
iscript20-Jul-09 5:15 
GeneralRe: Horizontal ScrollBar does not work in the TextBox control... anymore. Pin
Dave Pie19-Aug-11 9:01
Dave Pie19-Aug-11 9:01 
Questionhow to detect toolbar click in Internet explorer Pin
vikas_kohli8220-Jul-09 3:14
vikas_kohli8220-Jul-09 3:14 
QuestionWould it crash the normal functioning of the program? Pin
Member 246491120-Jul-09 3:10
Member 246491120-Jul-09 3:10 
AnswerRe: Would it crash the normal functioning of the program? Pin
DaveyM6920-Jul-09 3:34
professionalDaveyM6920-Jul-09 3:34 
AnswerRe: Would it crash the normal functioning of the program? Pin
Luc Pattyn20-Jul-09 4:01
sitebuilderLuc Pattyn20-Jul-09 4:01 
Adding to Dave's reply, a lot of handlers execute on the main thread (aka GUI thread). Obviously that thread can only do one thing at a time, so it deals with the messages from its input queue one by one. That is why changing a Label.Text and performing a lengthy operation in one handler only shows the changed text after the operation has finished.

However there is a whole bunch of asynchronous handlers (mostly "input handlers" such as for networking, SerialPort, etc) that run on different threads, normally ThreadPool threads. I did a little experiment[^] on the subject. One of the conclusions is methods called from such handlers could be running concurrently, depending on the source of the event. Say two serial ports calling the same method. So if you are not sure, do at least one of the following:
- check the documentation (it often isn't very specific on this issue);
- perform a little experiment (as I did);
- when still in doubt, or to make sure, provide a synchronization mechanism (maybe use a lock); be careful though since that may cause new issues.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

Questionhow can I merge images from two different pictureboxes into one picturebox? Pin
strife1920-Jul-09 2:51
strife1920-Jul-09 2:51 
AnswerRe: how can I merge images from two different pictureboxes into one picturebox? Pin
dan!sh 20-Jul-09 2:59
professional dan!sh 20-Jul-09 2:59 
GeneralRe: how can I merge images from two different pictureboxes into one picturebox? Pin
strife1920-Jul-09 3:35
strife1920-Jul-09 3:35 
GeneralRe: how can I merge images from two different pictureboxes into one picturebox? Pin
Member 1075676119-Apr-14 19:29
Member 1075676119-Apr-14 19:29 
QuestionUser control Pin
john563220-Jul-09 2:26
john563220-Jul-09 2:26 
AnswerRe: User control Pin
musefan20-Jul-09 2:30
musefan20-Jul-09 2:30 
QuestionBlocking inheritance methods Pin
bonzaiholding20-Jul-09 1:53
bonzaiholding20-Jul-09 1:53 
AnswerRe: Blocking inheritance methods Pin
stancrm20-Jul-09 2:00
stancrm20-Jul-09 2:00 
GeneralRe: Blocking inheritance methods Pin
bonzaiholding20-Jul-09 2:28
bonzaiholding20-Jul-09 2:28 
GeneralRe: Blocking inheritance methods Pin
stancrm20-Jul-09 2:46
stancrm20-Jul-09 2:46 
GeneralRe: Blocking inheritance methods Pin
DaveyM6920-Jul-09 3:08
professionalDaveyM6920-Jul-09 3:08 
GeneralRe: Blocking inheritance methods Pin
PIEBALDconsult20-Jul-09 6:35
mvePIEBALDconsult20-Jul-09 6:35 
GeneralRe: Blocking inheritance methods Pin
DaveyM6920-Jul-09 9:25
professionalDaveyM6920-Jul-09 9:25 
AnswerRe: Blocking inheritance methods [modified] Pin
PIEBALDconsult20-Jul-09 4:26
mvePIEBALDconsult20-Jul-09 4:26 
Questioncompressing bytes Pin
shekhar25839520-Jul-09 1:46
shekhar25839520-Jul-09 1:46 
AnswerRe: compressing bytes Pin
stancrm20-Jul-09 1:50
stancrm20-Jul-09 1:50 
GeneralRe: compressing bytes Pin
musefan20-Jul-09 2:15
musefan20-Jul-09 2:15 

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.