Click here to Skip to main content
15,893,337 members
Home / Discussions / C#
   

C#

 
QuestionData reception from Multiple ports Pin
PS@Codeproj21-Nov-07 0:59
PS@Codeproj21-Nov-07 0:59 
AnswerRe: Data reception from Multiple ports Pin
Bekjong21-Nov-07 1:33
Bekjong21-Nov-07 1:33 
Questionservice doesn't start Pin
stephan_00721-Nov-07 0:18
stephan_00721-Nov-07 0:18 
AnswerRe: service doesn't start Pin
Pete O'Hanlon21-Nov-07 0:20
mvePete O'Hanlon21-Nov-07 0:20 
QuestionReading Contents of a folder from website Pin
arslanjatt21-Nov-07 0:17
arslanjatt21-Nov-07 0:17 
AnswerRe: Reading Contents of a folder from website Pin
Rob Philpott21-Nov-07 0:33
Rob Philpott21-Nov-07 0:33 
GeneralRe: Reading Contents of a folder from website Pin
arslanjatt21-Nov-07 0:48
arslanjatt21-Nov-07 0:48 
QuestionGetting Error when using System.Timers.Timer Pin
Satish - Developer21-Nov-07 0:14
Satish - Developer21-Nov-07 0:14 
Hi, I want to dispaly the time on the form. For every elapse the event should be raised. so for every 1000 milliseconds the time should be change on screen.
No other threads are running in my program...

But i getting the following error:
Cross-thread operation not valid: Control 'label1' accessed from a thread other than the thread it was created on.

please help.
Thanks in advance



private void button1_Click(object sender, EventArgs e)
{
label1.Text = Convert.ToString(DateTime.Now);
System.Timers.Timer objTimer = new System.Timers.Timer();
objTimer.Elapsed += new ElapsedEventHandler(DisplayTimeEvent);
objTimer.Interval = 1000;
objTimer.Start();
}

public void DisplayTimeEvent(object source, ElapsedEventArgs e)
{
label1.Text = Convert.ToString(DateTime.Now);
}


G. Satish
AnswerRe: Getting Error when using System.Timers.Timer Pin
Andrei Ungureanu21-Nov-07 0:22
Andrei Ungureanu21-Nov-07 0:22 
GeneralRe: Getting Error when using System.Timers.Timer [modified] Pin
Satish - Developer21-Nov-07 0:27
Satish - Developer21-Nov-07 0:27 
AnswerRe: Getting Error when using System.Timers.Timer Pin
Rob Philpott21-Nov-07 0:29
Rob Philpott21-Nov-07 0:29 
GeneralRe: Getting Error when using System.Timers.Timer Pin
Satish - Developer21-Nov-07 0:33
Satish - Developer21-Nov-07 0:33 
QuestionProblem sending email to Lotus iNote Pin
Jedidah20-Nov-07 23:53
Jedidah20-Nov-07 23:53 
QuestionAccessing Control.Focused property from Thread Pin
Sukhjinder_K20-Nov-07 23:36
Sukhjinder_K20-Nov-07 23:36 
AnswerRe: Accessing Control.Focused property from Thread [modified] Pin
Martin#20-Nov-07 23:44
Martin#20-Nov-07 23:44 
GeneralRe: Accessing Control.Focused property from Thread Pin
Stevo Z21-Nov-07 0:28
Stevo Z21-Nov-07 0:28 
GeneralRe: Accessing Control.Focused property from Thread [modified] Pin
Martin#21-Nov-07 0:41
Martin#21-Nov-07 0:41 
GeneralRe: Accessing Control.Focused property from Thread Pin
Stevo Z21-Nov-07 1:29
Stevo Z21-Nov-07 1:29 
GeneralThank you! Pin
Martin#21-Nov-07 1:59
Martin#21-Nov-07 1:59 
GeneralRe: Thank you! Pin
Stevo Z21-Nov-07 2:10
Stevo Z21-Nov-07 2:10 
GeneralThanks Everybody Pin
Sukhjinder_K23-Nov-07 5:33
Sukhjinder_K23-Nov-07 5:33 
Questionit send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
sivaramireddy p20-Nov-07 23:21
sivaramireddy p20-Nov-07 23:21 
GeneralPlease stay away of this forum! Pin
Martin#20-Nov-07 23:26
Martin#20-Nov-07 23:26 
GeneralRe: Please stay away of this forum! Pin
Bekjong20-Nov-07 23:52
Bekjong20-Nov-07 23:52 
AnswerRe: it send data to tcp/ip port number, ex 8080, now i want to write socket program to read data from that port. Any body help me? How can i do that? Pin
Andrei Ungureanu20-Nov-07 23:50
Andrei Ungureanu20-Nov-07 23:50 

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.