Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
QuestionTrouble using Canon's EDSDK in VS on mac Pin
Member 1543145718-Nov-21 4:19
Member 1543145718-Nov-21 4:19 
AnswerRe: Trouble using Canon's EDSDK in VS on mac Pin
Luc Pattyn18-Nov-21 4:55
sitebuilderLuc Pattyn18-Nov-21 4:55 
QuestionC sharp Picturebox linking error Pin
ÖmürTokman8-Nov-21 23:05
ÖmürTokman8-Nov-21 23:05 
AnswerRe: C sharp Picturebox linking error Pin
OriginalGriff8-Nov-21 23:27
mveOriginalGriff8-Nov-21 23:27 
GeneralRe: C sharp Picturebox linking error Pin
ÖmürTokman9-Nov-21 0:09
ÖmürTokman9-Nov-21 0:09 
GeneralRe: C sharp Picturebox linking error Pin
OriginalGriff9-Nov-21 0:17
mveOriginalGriff9-Nov-21 0:17 
AnswerRe: C sharp Picturebox linking error Pin
Richard MacCutchan8-Nov-21 23:39
mveRichard MacCutchan8-Nov-21 23:39 
GeneralRe: C sharp Picturebox linking error Pin
ÖmürTokman9-Nov-21 0:13
ÖmürTokman9-Nov-21 0:13 
AnswerRe: C sharp Picturebox linking error Pin
Eddy Vluggen10-Nov-21 3:06
professionalEddy Vluggen10-Nov-21 3:06 
Questionwriting content of csv files into oracle Pin
md arif 20214-Nov-21 23:27
md arif 20214-Nov-21 23:27 
AnswerRe: writing content of csv files into oracle Pin
Richard MacCutchan5-Nov-21 0:34
mveRichard MacCutchan5-Nov-21 0:34 
AnswerRe: writing content of csv files into oracle Pin
OriginalGriff5-Nov-21 1:30
mveOriginalGriff5-Nov-21 1:30 
GeneralRe: writing content of csv files into oracle Pin
Richard MacCutchan5-Nov-21 2:09
mveRichard MacCutchan5-Nov-21 2:09 
QuestionDerived Treeview override not being called at all. Pin
pr1mem0ver4-Nov-21 3:47
pr1mem0ver4-Nov-21 3:47 
AnswerRe: Derived Treeview override not being called at all. Pin
Richard Deeming4-Nov-21 4:01
mveRichard Deeming4-Nov-21 4:01 
GeneralRe: Derived Treeview override not being called at all. Pin
primem0ver4-Nov-21 5:17
primem0ver4-Nov-21 5:17 
GeneralRe: Derived Treeview override not being called at all. Pin
Richard Deeming4-Nov-21 5:32
mveRichard Deeming4-Nov-21 5:32 
GeneralRe: Derived Treeview override not being called at all. Pin
primem0ver4-Nov-21 5:42
primem0ver4-Nov-21 5:42 
GeneralRe: Derived Treeview override not being called at all. Pin
BillWoodruff4-Nov-21 23:56
professionalBillWoodruff4-Nov-21 23:56 
AnswerRe: Derived Treeview override not being called at all. Pin
BillWoodruff4-Nov-21 23:55
professionalBillWoodruff4-Nov-21 23:55 
SuggestionCron mechanism Pin
johnpierwszy3-Nov-21 22:34
johnpierwszy3-Nov-21 22:34 
GeneralRe: Cron mechanism Pin
OriginalGriff3-Nov-21 22:54
mveOriginalGriff3-Nov-21 22:54 
You either need to set up a Timer Class (System.Timers) | Microsoft Docs[^] or a BackgroundWorker Class (System.ComponentModel) | Microsoft Docs[^]

Either will do, but without one or the other, you will block the UI thread waiting for the timeout to elapse - which will make it look like the whole application is locked up!

Me? I'd use a background worker and use the Progress reporting mechanism to update the UI thread when necessary:
C#
private void FrmMain_Shown(object sender, EventArgs epp)
    {
    BackgroundWorker work = new BackgroundWorker();
    work.DoWork += Work_DoWork;
    work.ProgressChanged += Work_ProgressChanged;
    work.RunWorkerCompleted += Work_RunWorkerCompleted;
    work.WorkerReportsProgress = true;
    work.RunWorkerAsync("A parameter of any type you want to pass it");
    }

private void Work_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
    MyTextBox.Text = "Done.";
    }

private void Work_ProgressChanged(object sender, ProgressChangedEventArgs e)
    {
    MyTextBox.Text = ($"Progress: {e.ProgressPercentage} - {e.UserState as string}");
    }

private void Work_DoWork(object sender, DoWorkEventArgs e)
    {
    if (sender is BackgroundWorker work)
        {
        for (int i = 0; i < 1000000; i++)
            {
            Thread.Sleep(1000);
            work.ReportProgress(i / 10000, $"An object of any type you want to pass back to the main thread: {i}");
            }
        }
    }

"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Cron mechanism Pin
johnpierwszy3-Nov-21 23:13
johnpierwszy3-Nov-21 23:13 
GeneralRe: Cron mechanism Pin
OriginalGriff3-Nov-21 23:18
mveOriginalGriff3-Nov-21 23:18 
GeneralRe: Cron mechanism Pin
johnpierwszy3-Nov-21 23:21
johnpierwszy3-Nov-21 23:21 

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.