Click here to Skip to main content
15,891,739 members
Home / Discussions / C#
   

C#

 
GeneralRe: Timer doesn´t work by Server and Client! Pin
nhqlbaislwfiikqraqnm22-Aug-09 5:18
nhqlbaislwfiikqraqnm22-Aug-09 5:18 
GeneralRe: Timer doesn´t work by Server and Client! Pin
Saksida Bojan22-Aug-09 6:57
Saksida Bojan22-Aug-09 6:57 
AnswerRe: Timer doesn´t work by Server and Client! Pin
Alan N22-Aug-09 7:23
Alan N22-Aug-09 7:23 
GeneralRe: Timer doesn´t work by Server and Client! Pin
Saksida Bojan22-Aug-09 11:53
Saksida Bojan22-Aug-09 11:53 
GeneralRe: Timer doesn´t work by Server and Client! Pin
Alan N22-Aug-09 13:25
Alan N22-Aug-09 13:25 
GeneralRe: Timer doesn´t work by Server and Client! Pin
Saksida Bojan22-Aug-09 18:58
Saksida Bojan22-Aug-09 18:58 
GeneralRe: Timer doesn´t work by Server and Client! Pin
nhqlbaislwfiikqraqnm22-Aug-09 23:12
nhqlbaislwfiikqraqnm22-Aug-09 23:12 
AnswerRe: Timer doesn´t work by Server and Client! Pin
Alan N23-Aug-09 6:24
Alan N23-Aug-09 6:24 
Hi,
Finally you post code showing the root cause of the problem. The Listen method is running on a secondary thread and the System.Windows.Forms.Timer is designed to operate on the UI thread only.

You may

1) Wrap the timer manipulation code in a method and use this.Invoke and a method delegate to force the code to run on the UI thread.

OR

2) Change the timer to either System.Threading.Timer or System.Timer.

Option 2 would be the cleaner solution.

Alan.
GeneralRe: Timer doesn´t work by Server and Client! Pin
nhqlbaislwfiikqraqnm23-Aug-09 23:36
nhqlbaislwfiikqraqnm23-Aug-09 23:36 
GeneralRe: Timer doesn´t work by Server and Client! Pin
Alan N24-Aug-09 0:56
Alan N24-Aug-09 0:56 
GeneralMessage Closed Pin
24-Aug-09 22:55
nhqlbaislwfiikqraqnm24-Aug-09 22:55 
AnswerRe: Timer doesn´t work by Server and Client! Pin
Alan N25-Aug-09 6:21
Alan N25-Aug-09 6:21 
Question[Message Deleted] Pin
Ajithevn21-Aug-09 22:35
Ajithevn21-Aug-09 22:35 
AnswerRe: click event of a selected date in c# Pin
Vimalsoft(Pty) Ltd21-Aug-09 23:19
professionalVimalsoft(Pty) Ltd21-Aug-09 23:19 
Questionproblem with fileupload.hasfile Pin
Priyagdpl21-Aug-09 21:44
Priyagdpl21-Aug-09 21:44 
AnswerRe: problem with fileupload.hasfile Pin
Xmen Real 21-Aug-09 23:18
professional Xmen Real 21-Aug-09 23:18 
Questionneed PulsAll in locked section? Pin
elvis_pan21-Aug-09 21:35
elvis_pan21-Aug-09 21:35 
AnswerRe: need PulsAll in locked section? Pin
Saksida Bojan21-Aug-09 21:56
Saksida Bojan21-Aug-09 21:56 
QuestionLink in Dynamic menu Pin
rummer21-Aug-09 20:33
rummer21-Aug-09 20:33 
AnswerRe: Link in Dynamic menu Pin
Saksida Bojan21-Aug-09 20:49
Saksida Bojan21-Aug-09 20:49 
Questionproblem reading an Excel file Pin
VCsamir21-Aug-09 20:17
VCsamir21-Aug-09 20:17 
AnswerRe: problem reading an Excel file Pin
Suresh Suthar21-Aug-09 20:39
professionalSuresh Suthar21-Aug-09 20:39 
QuestionLink in Dynamic menu Pin
rummer21-Aug-09 19:18
rummer21-Aug-09 19:18 
AnswerRe: Link in Dynamic menu [modified] Pin
Saksida Bojan21-Aug-09 19:47
Saksida Bojan21-Aug-09 19:47 
QuestionHow to source code c++ language modify to with XML in c# ? Pin
bolly12521-Aug-09 17:55
bolly12521-Aug-09 17:55 

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.