Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
GeneralRe: Returning date time as null Pin
Luc Pattyn3-Dec-09 9:02
sitebuilderLuc Pattyn3-Dec-09 9:02 
QuestionC# application to sort SQL database data and output to CSV file Pin
totally_stumped3-Dec-09 4:38
totally_stumped3-Dec-09 4:38 
AnswerRe: C# application to sort SQL database data and output to CSV file Pin
dan!sh 3-Dec-09 4:55
professional dan!sh 3-Dec-09 4:55 
AnswerRe: C# application to sort SQL database data and output to CSV file Pin
Shorgov3-Dec-09 5:13
Shorgov3-Dec-09 5:13 
AnswerRe: C# application to sort SQL database data and output to CSV file Pin
PIEBALDconsult3-Dec-09 5:15
mvePIEBALDconsult3-Dec-09 5:15 
QuestionKilling threads on form closing... Pin
Jacob Dixon3-Dec-09 2:59
Jacob Dixon3-Dec-09 2:59 
AnswerRe: Killing threads on form closing... Pin
Luc Pattyn3-Dec-09 3:12
sitebuilderLuc Pattyn3-Dec-09 3:12 
GeneralRe: Killing threads on form closing... Pin
Jacob Dixon3-Dec-09 3:19
Jacob Dixon3-Dec-09 3:19 
Oh... In the method that I created the thread for it does use invoke.. Now while we are on that subject I've noticed there are multiple ways of invoking a control. The way I chose to do it required less lines of code in my opinion and without the need of created another method outside of this one:

Invoke((Action)(() => { labelFiles.Text = string.Format("Saving File... Size: {0}MB", Math.Round((fileSize / 1024) / 1024, 2)); }));


The way I have been doing it was like this:

private delegate void FilesLabelDelegate(string text);
private void FilesLabel(string text)
{
   labelFiles.Tex = "blahblahblah";
}

// In the thread:
Invoke(new FilesLabelDelegate(FilesLabel), new object[] { "blahblahblah" }));


I'm assuming that between the two isn't really a performance difference that would matter as much?

Anyways,

So before the thread starts I could set something saying that a file is currently being saved, and when the thread comes to an end I need to set that something back to false (like a variable). And on the FormClosing if that variable is true then display that we can't exit until the file is saved and call the e.Cancel = true;

That is a great idea thanks
GeneralRe: Killing threads on form closing... Pin
Luc Pattyn3-Dec-09 3:28
sitebuilderLuc Pattyn3-Dec-09 3:28 
GeneralRe: Killing threads on form closing... Pin
Jacob Dixon3-Dec-09 3:36
Jacob Dixon3-Dec-09 3:36 
GeneralRe: Killing threads on form closing... Pin
Luc Pattyn3-Dec-09 3:58
sitebuilderLuc Pattyn3-Dec-09 3:58 
GeneralRe: Killing threads on form closing... Pin
ely_bob3-Dec-09 8:03
professionalely_bob3-Dec-09 8:03 
AnswerRe: Killing threads on form closing... Pin
Nicholas Butler3-Dec-09 3:17
sitebuilderNicholas Butler3-Dec-09 3:17 
GeneralRe: Killing threads on form closing... Pin
Jacob Dixon3-Dec-09 3:21
Jacob Dixon3-Dec-09 3:21 
GeneralRe: Killing threads on form closing... Pin
Nicholas Butler3-Dec-09 3:36
sitebuilderNicholas Butler3-Dec-09 3:36 
AnswerRe: Killing threads on form closing... Pin
Ian Shlasko3-Dec-09 3:20
Ian Shlasko3-Dec-09 3:20 
GeneralRe: Killing threads on form closing... Pin
Jacob Dixon3-Dec-09 3:32
Jacob Dixon3-Dec-09 3:32 
GeneralRe: Killing threads on form closing... Pin
Ian Shlasko3-Dec-09 4:04
Ian Shlasko3-Dec-09 4:04 
GeneralRe: Killing threads on form closing... Pin
Jacob Dixon3-Dec-09 3:43
Jacob Dixon3-Dec-09 3:43 
GeneralRe: Killing threads on form closing... Pin
Luc Pattyn3-Dec-09 5:38
sitebuilderLuc Pattyn3-Dec-09 5:38 
AnswerRe: Killing threads on form closing... Pin
PIEBALDconsult3-Dec-09 4:49
mvePIEBALDconsult3-Dec-09 4:49 
QuestionRedundant function? Pin
Spoon Of Doom3-Dec-09 2:51
Spoon Of Doom3-Dec-09 2:51 
AnswerRe: Redundant function? Pin
David Skelly3-Dec-09 3:05
David Skelly3-Dec-09 3:05 
AnswerRe: Redundant function? Pin
J4amieC3-Dec-09 3:10
J4amieC3-Dec-09 3:10 
AnswerRe: Redundant function? Pin
Spoon Of Doom3-Dec-09 3:25
Spoon Of Doom3-Dec-09 3:25 

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.