R
Rich
Sorry for looking for help with what are probably very elementary
issues, but I'm new to both .NET and the CF and getting frustrated.
I've seen several examples on this board and on MSDN which have gotten
me along the correct path (I think) but I'm not quite putting all of
the pieces together.
Basically, a series of processing steps are executed upon click of a
button. As these steps are executed, I would like to update status and
progress bars on the calling form. I think I need to start a thread in
the button click event and use control.invoke in the class method to
update form elements. Please see psuedo code below:
*******************************************************************
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Project
{
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.StatusBar statusBar1;
public Form2()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void InitializeComponent()
{
private void button1_Click(object sender, System.EventArgs e)
{
//kick off series of processing steps
//need to update status and progress bar as processing progresses
Class1 processor = new Class1();
//start thread?
processor.processStuff();
}
}
using System;
namespace EquipCertification
{
public class Class1
{
public Class1()
{
}
public void processStuff()
{
//processing step 1
//update status bar/progress bar
//control.invoke?
//processing step 2
//update status bar/progress bar //control.invoke?
//processing step 3
//update status bar/progress bar
//control.invoke? }
}
}
*******************************************************************
Any suggestions or advice?
Thank you in advance.
Rich
issues, but I'm new to both .NET and the CF and getting frustrated.
I've seen several examples on this board and on MSDN which have gotten
me along the correct path (I think) but I'm not quite putting all of
the pieces together.
Basically, a series of processing steps are executed upon click of a
button. As these steps are executed, I would like to update status and
progress bars on the calling form. I think I need to start a thread in
the button click event and use control.invoke in the class method to
update form elements. Please see psuedo code below:
*******************************************************************
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Project
{
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.StatusBar statusBar1;
public Form2()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
private void InitializeComponent()
{
private void button1_Click(object sender, System.EventArgs e)
{
//kick off series of processing steps
//need to update status and progress bar as processing progresses
Class1 processor = new Class1();
//start thread?
processor.processStuff();
}
}
using System;
namespace EquipCertification
{
public class Class1
{
public Class1()
{
}
public void processStuff()
{
//processing step 1
//update status bar/progress bar
//control.invoke?
//processing step 2
//update status bar/progress bar //control.invoke?
//processing step 3
//update status bar/progress bar
//control.invoke? }
}
}
*******************************************************************
Any suggestions or advice?
Thank you in advance.
Rich