Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Windows Forms - outputting info to a textbox without crashing
    primarykey
    data
    text
    <p>In a Windows Forms app, I am using Quartz.NET to run some tasks every few minutes. Previously, this application was a console application that was invoked based on a schedule but for various reasons this wasn't ideal - back then all debug info was outputted to the console.</p> <p>In this version, I need a way to show the debug information for a job on the user's screen. My initial idea was a new form that is shown when a job is run, and all debug information is appended to a multiline textbox on that form. However, this doesn't work as most of the app seems to crash when I do this.</p> <p>Any other ideas?</p> <p>EDIT: Sorry for any confusion. This is what's called when a job executes:</p> <pre><code> public virtual void Execute(JobExecutionContext context) { RunJob jobForm = new RunJob(); jobForm.Show(); jobForm.JobLabel = context.JobDetail.JobDataMap.GetString("Name"); for (int i = 0; i &lt; 100; i++) { jobForm.WriteLine(i.ToString()); } jobForm.Hide(); } </code></pre> <p>And this is the contents of the 'RunJob' form:</p> <pre><code>public partial class RunJob : Form { public string JobLabel { get { return lblJobName.Text; } set { lblJobName.Text = value; } } public void WriteLine(string text) { textBox1.AppendText(text + Environment.NewLine); } public RunJob() { InitializeComponent(); } } </code></pre> <p>Basically, the RunJob window freezes when the text is being appended, when ideally it'd just add the text smoothly. I understand 'crash' was a very poor choice of word! My excuse is that it's early in the morning, ahem </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload