Click here to Skip to main content
15,906,341 members
Home / Discussions / C#
   

C#

 
GeneralRe: A program to delete first n bytes in a file Pin
Giorgi Dalakishvili24-Nov-08 20:02
mentorGiorgi Dalakishvili24-Nov-08 20:02 
GeneralRe: A program to delete first n bytes in a file Pin
Matjaz-xyz24-Nov-08 20:30
Matjaz-xyz24-Nov-08 20:30 
GeneralRe: A program to delete first n bytes in a file Pin
Giorgi Dalakishvili24-Nov-08 20:42
mentorGiorgi Dalakishvili24-Nov-08 20:42 
GeneralRe: A program to delete first n bytes in a file Pin
Matjaz-xyz24-Nov-08 21:24
Matjaz-xyz24-Nov-08 21:24 
GeneralRe: A program to delete first n bytes in a file Pin
Giorgi Dalakishvili24-Nov-08 21:28
mentorGiorgi Dalakishvili24-Nov-08 21:28 
GeneralRe: A program to delete first n bytes in a file Pin
Member 1519807030-Sep-22 23:31
Member 1519807030-Sep-22 23:31 
AnswerRe: A program to delete first n bytes in a file Pin
Giorgi Dalakishvili23-Nov-08 21:06
mentorGiorgi Dalakishvili23-Nov-08 21:06 
QuestionDisabling Button until thread complete Pin
K V Sekhar23-Nov-08 20:42
K V Sekhar23-Nov-08 20:42 
Hi all,

I have to Disable 'Start' button untill the thread completes.

btn_Start_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThraedStart(Download));
th.Start();

if (th.ThreadState == ThreadState.Running) // Here i am Disabling
btn_Start.Enabled = false;

// But where i have write logic for Enabling the Button
//like if(th.ThreadState==ThreadState.Stopped) btn_Start.Enabled = true;

}

public void Download()
{
// Here i wrote logic for downloading files.
}


Please suggest me how to Disable Button until thread completes.


Thanks in Advance
AnswerRe: Disabling Button until thread complete Pin
N a v a n e e t h23-Nov-08 20:45
N a v a n e e t h23-Nov-08 20:45 
GeneralRe: Disabling Button until thread complete Pin
K V Sekhar23-Nov-08 20:53
K V Sekhar23-Nov-08 20:53 
GeneralRe: Disabling Button until thread complete Pin
N a v a n e e t h23-Nov-08 20:56
N a v a n e e t h23-Nov-08 20:56 
AnswerRe: Disabling Button until thread complete Pin
Stephen Lintott23-Nov-08 20:47
Stephen Lintott23-Nov-08 20:47 
GeneralRe: Disabling Button until thread complete Pin
K V Sekhar23-Nov-08 20:54
K V Sekhar23-Nov-08 20:54 
AnswerRe: Disabling Button until thread complete Pin
Christian Graus23-Nov-08 20:51
protectorChristian Graus23-Nov-08 20:51 
GeneralRe: Disabling Button until thread complete Pin
K V Sekhar23-Nov-08 20:55
K V Sekhar23-Nov-08 20:55 
AnswerRe: Disabling Button until thread complete Pin
Giorgi Dalakishvili23-Nov-08 21:02
mentorGiorgi Dalakishvili23-Nov-08 21:02 
QuestionHow to create stored procedure through c# at runtime? Pin
S a n d y23-Nov-08 20:35
S a n d y23-Nov-08 20:35 
AnswerRe: How to create stored procedure through c# at runtime? Pin
N a v a n e e t h23-Nov-08 20:51
N a v a n e e t h23-Nov-08 20:51 
GeneralRe: How to create stored procedure through c# at runtime? Pin
S a n d y23-Nov-08 21:00
S a n d y23-Nov-08 21:00 
GeneralRe: How to create stored procedure through c# at runtime? Pin
N a v a n e e t h23-Nov-08 21:47
N a v a n e e t h23-Nov-08 21:47 
GeneralRe: How to create stored procedure through c# at runtime? Pin
S a n d y23-Nov-08 22:40
S a n d y23-Nov-08 22:40 
GeneralRe: How to create stored procedure through c# at runtime? Pin
James Simpson24-Nov-08 1:31
James Simpson24-Nov-08 1:31 
GeneralRe: How to create stored procedure through c# at runtime? Pin
S a n d y24-Nov-08 1:53
S a n d y24-Nov-08 1:53 
GeneralRe: How to create stored procedure through c# at runtime? Pin
Giorgi Dalakishvili23-Nov-08 21:17
mentorGiorgi Dalakishvili23-Nov-08 21:17 
GeneralRe: How to create stored procedure through c# at runtime? Pin
S a n d y23-Nov-08 21:19
S a n d y23-Nov-08 21:19 

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.