M
mortb
Hi,
I want to be able to run a winform from the command line both with and
without arguments
When I create the winform visualstudio I get a main method looking like
this:
STAThread]
static void Main(string[] args)
{
Application.Run(new Form1());
}
If I get some commandline parameters I want to run another method
"shrinkPictures"
and I want this second method to manipulate a progressbar on the From so
I've tried:
[STAThread]
static void Main(string[] args)
{
Form1 frm = new Form1();
frm.shrinkPictures(args);
Application.Run(frm);
}
public void shrinkPictures(string [] bitmapFileNames)
{
// do stuff
}
This works, but doesn't show the form until after the method
"shrinkpictures" is finnished
and shifting places on the lines like:
Application.Run(frm);
frm.shrinkPictures(args);
Will not run the method "shrinkPictures" until the user closes the
applicaiton.
How do I solve this?
cheers,
mortb
I want to be able to run a winform from the command line both with and
without arguments
When I create the winform visualstudio I get a main method looking like
this:
STAThread]
static void Main(string[] args)
{
Application.Run(new Form1());
}
If I get some commandline parameters I want to run another method
"shrinkPictures"
and I want this second method to manipulate a progressbar on the From so
I've tried:
[STAThread]
static void Main(string[] args)
{
Form1 frm = new Form1();
frm.shrinkPictures(args);
Application.Run(frm);
}
public void shrinkPictures(string [] bitmapFileNames)
{
// do stuff
}
This works, but doesn't show the form until after the method
"shrinkpictures" is finnished
and shifting places on the lines like:
Application.Run(frm);
frm.shrinkPictures(args);
Will not run the method "shrinkPictures" until the user closes the
applicaiton.
How do I solve this?
cheers,
mortb