I'm writing a console program that can accept 1 to 3 files. I'm using OpenFileDialog three times to accept the files, but the second time and third the file dialog is behind the console window, making it hard to notice. Any way to get it to appear above?
An image of the problem: http://img205.imageshack.us/img205/5312/problemr.png
The relevant code is:
static bool loadFile(ref List<string> ls)
{
OpenFileDialog f = new OpenFileDialog();
if (f.ShowDialog() == DialogResult.OK)
{
Console.WriteLine("Loaded file {0}", f.FileName);
ls.Add(f.FileName);
return true;
}
else
{
return false;
}
}
[STAThread]
static void Main(string[] args)
{
//sanity check
if (args.Length > 3)
{
Console.WriteLine("Sorry, this program currently supports a maximum of three different reports to analyze at a time.");
return;
}
else if (args.Length == 0)
{
List<string> fL = new List<string>();
for (int k = 0; k < 3; k++)
{
if (!loadFile(ref fL)) break;
}
if (fL.Count == 0)
{
InfoDisplay.HelpMessage();
return;
}
else
{
args = fL.ToArray();
}
}
//main program