0

I have this code and it opens the my documents accordingly. but the problem is it is below my application i want it above my main form

     String path = @"C:\Users\Diether\Documents";
     System.Diagnostics.Process prc = new System.Diagnostics.Process();
     prc.StartInfo.FileName = path;
     prc.Start();
  • I'm surprised it appears below your application. Does it do that even if not running under a debugger? You could always just minimise your application after launching Explorer, if that would be better. – Neil Feb 07 '19 at 15:24
  • 1
    Off-topic, but get the documents folder using: `Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)` – Reza Aghaei Feb 07 '19 at 15:26
  • 1
    It may happen if `TopMost` property of the main form is set to `true`. – Reza Aghaei Feb 07 '19 at 15:28

1 Answers1

0

You can use StartInfo, maybe this helps you: prc.StartInfo.CreateNoWindow = true; you have to insert it before the prc.Start();-line.

OR

you minimize your window when you open the explorer: example

Cizzl
  • 324
  • 2
  • 11