L
Lobsterpants
Hi folks,
I am developing an application that will either:
1. Run completly through the GUI (no command line options set)
2. Run completly through the command line
3. Allow the user to default some options through the command line and
then open the GUI with these options set.
I can acheve all of this EXCEPT when I run I always get a console
window even if I have gone straight into the gui. Is there a way to
acheve what I am after as I have googled like crazy and not got close -
here is what I have so far:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void Main(string[] Args)
{
Arguments CommandLine=new Arguments(Args);
//help
if(CommandLine["h"] != null)
{
Console.WriteLine("output help...");
}
else
{
frmmyForm myForm = new frmmyForm();
if(CommandLine["Flag"] != null)
{
myForm.SetUserFlag = true; //default a field on the form
}
//out File
if(CommandLine["O"] != null)
{
myForm.OutFile = CommandLine["O"];
myForm.GoSpoodle(); //we have enough info so do the proccessing
}
else
{
Application.Run (myForm);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All help gratefully received
I am developing an application that will either:
1. Run completly through the GUI (no command line options set)
2. Run completly through the command line
3. Allow the user to default some options through the command line and
then open the GUI with these options set.
I can acheve all of this EXCEPT when I run I always get a console
window even if I have gone straight into the gui. Is there a way to
acheve what I am after as I have googled like crazy and not got close -
here is what I have so far:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void Main(string[] Args)
{
Arguments CommandLine=new Arguments(Args);
//help
if(CommandLine["h"] != null)
{
Console.WriteLine("output help...");
}
else
{
frmmyForm myForm = new frmmyForm();
if(CommandLine["Flag"] != null)
{
myForm.SetUserFlag = true; //default a field on the form
}
//out File
if(CommandLine["O"] != null)
{
myForm.OutFile = CommandLine["O"];
myForm.GoSpoodle(); //we have enough info so do the proccessing
}
else
{
Application.Run (myForm);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All help gratefully received