Harry123

I use the following code to open a directory in my C# app:

string sNewFileDir = Application.StartupPath + "\\MyFolder";

System.Diagnostics.Process.Start(sNewFileDir);

My problem is that the folder opens 'Maximised'...How can I open the folder so that it is not maximised

And also , is there a way to select a certain file in this folder and have it highlighted

Thanks

Harry



Re: Visual C# General Open directory so it is not 'Maximised'

Peter Ritchie

You could try using the Start override that takes a ProcessStartInfo parameter and set the ProcessStartInfo.WindowStyle property to ProcessWindowStyle.Normal:

Code Snippet

ProcessStartInfo processStartInfo = new ProcessStartInfo(@"C:\Program Files");

processStartInfo.WindowStyle = ProcessWindowStyle.Normal;

Process.Start(processStartInfo);