Click here to Skip to main content
15,909,205 members
Home / Discussions / C#
   

C#

 
QuestionTimer Controll in Thread Pin
DeepOceans8-Jun-08 23:51
DeepOceans8-Jun-08 23:51 
Hello
I m developing a window application. I m doing diferent tasks against different events using multi-threading. Against 1 thread , I m enabling the timer, and against its function I m performing 1 task, but it is not working i.e it is not executing the timer function. if I put all the code against some button rather than within thread , then it works well.
plz tell me how could I use the Timer within the thread.
here is my Code.

private void Start_Click(object sender, EventArgs e)
{

pthrd = new Thread(new ThreadStart(Thrd1));
pthrd .Start();

}
void Thrd1()
{
MessageBox.Show("Thread Start");
timer1.Enabled = true;
}


private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("Start Grabbing");
Calculate();
}

Shanzay

AnswerRe: Timer Controll in Thread Pin
Gareth H9-Jun-08 1:04
Gareth H9-Jun-08 1:04 
GeneralRe: Timer Controll in Thread Pin
DeepOceans9-Jun-08 1:22
DeepOceans9-Jun-08 1:22 
AnswerRe: Timer Controll in Thread Pin
#realJSOP9-Jun-08 2:51
professional#realJSOP9-Jun-08 2:51 
AnswerRe: Timer Controll in Thread Pin
PIEBALDconsult9-Jun-08 5:51
mvePIEBALDconsult9-Jun-08 5:51 
GeneralRe: Timer Controll in Thread Pin
#realJSOP9-Jun-08 5:54
professional#realJSOP9-Jun-08 5:54 
GeneralRe: Timer Controll in Thread Pin
PIEBALDconsult9-Jun-08 13:41
mvePIEBALDconsult9-Jun-08 13:41 
GeneralRe: Timer Controll in Thread Pin
#realJSOP10-Jun-08 0:11
professional#realJSOP10-Jun-08 0:11 
Questionserialize atextbox control Pin
Elesh8-Jun-08 23:41
Elesh8-Jun-08 23:41 
GeneralRe: serialize atextbox control Pin
ncjlee9-Jun-08 0:33
ncjlee9-Jun-08 0:33 
QuestionListBox throwing a "Not valid value"-exception Pin
Gadjuka8-Jun-08 23:14
Gadjuka8-Jun-08 23:14 
AnswerRe: ListBox throwing a "Not valid value"-exception Pin
#realJSOP9-Jun-08 2:57
professional#realJSOP9-Jun-08 2:57 
GeneralRe: ListBox throwing a "Not valid value"-exception Pin
Gadjuka9-Jun-08 20:02
Gadjuka9-Jun-08 20:02 
GeneralRe: ListBox throwing a "Not valid value"-exception Pin
#realJSOP10-Jun-08 0:10
professional#realJSOP10-Jun-08 0:10 
QuestionSortedDictionary v.s. Dictionary Pin
George_George8-Jun-08 22:41
George_George8-Jun-08 22:41 
AnswerRe: SortedDictionary v.s. Dictionary Pin
leppie9-Jun-08 3:43
leppie9-Jun-08 3:43 
GeneralRe: SortedDictionary v.s. Dictionary Pin
George_George9-Jun-08 16:57
George_George9-Jun-08 16:57 
QuestionX509Store from file Pin
komadich8-Jun-08 22:40
komadich8-Jun-08 22:40 
GeneralRe: X509Store from file Pin
telha9-Jun-08 0:40
telha9-Jun-08 0:40 
QuestionEncoding problem with string from DLL Pin
steve_rm8-Jun-08 21:46
steve_rm8-Jun-08 21:46 
AnswerRe: Encoding problem with string from DLL Pin
ncjlee8-Jun-08 21:56
ncjlee8-Jun-08 21:56 
QuestionRe: Encoding problem with string from DLL Pin
steve_rm9-Jun-08 1:45
steve_rm9-Jun-08 1:45 
AnswerRe: Encoding problem with string from DLL Pin
ncjlee9-Jun-08 2:40
ncjlee9-Jun-08 2:40 
QuestionRe: Encoding problem with string from DLL Pin
steve_rm9-Jun-08 16:33
steve_rm9-Jun-08 16:33 
Questioni want to upload all files from one folder( in client side) to server without browse option Pin
md_azy8-Jun-08 21:30
md_azy8-Jun-08 21:30 

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.