S
sony.m.2007
Hi,
My application processes a file and updates the data into sql server.
The process takes around 30-90 seconds.I decided to put a timer to
display the user a label(making label visible false and true) with
message like "processing..." and do the other process using thread.
The timer won't works when the thread is started, so the label is not
displayed in the form
I have a label label1,a timer timer1 and command button in a form
timer1.interval=100;
private void timer1_Tick(object sender, System.EventArgs e)
{
label1.Visible = ! label1.Visible;
}
private void commandButton_Click(object sender, System.EventArgs e)
{
timer1.enabled=true;
label1.visible=true;
this.refresh
Thread t=new thread(new threadstart(updateMethod))
t.start()
timer1.enabled=false;
label1.visible=false
}
When I execute the above code label is not displayed in the
form.After the completion of thread only label get displayed.
Is there anything wrong in the above method of blinking a label?
Cheers,
Sony
My application processes a file and updates the data into sql server.
The process takes around 30-90 seconds.I decided to put a timer to
display the user a label(making label visible false and true) with
message like "processing..." and do the other process using thread.
The timer won't works when the thread is started, so the label is not
displayed in the form
I have a label label1,a timer timer1 and command button in a form
timer1.interval=100;
private void timer1_Tick(object sender, System.EventArgs e)
{
label1.Visible = ! label1.Visible;
}
private void commandButton_Click(object sender, System.EventArgs e)
{
timer1.enabled=true;
label1.visible=true;
this.refresh
Thread t=new thread(new threadstart(updateMethod))
t.start()
timer1.enabled=false;
label1.visible=false
}
When I execute the above code label is not displayed in the
form.After the completion of thread only label get displayed.
Is there anything wrong in the above method of blinking a label?
Cheers,
Sony