Home > Back-end >  Set Height, Width the popup window explorer
Set Height, Width the popup window explorer

Time:07-01

I am trying to set a specific width and height of the popup window explorer but the window explorer did not set accordingly. Any help would be greatly appreciated


Process.Start(Directory.GetCurrentDirectory()   @\Setting);
string dir = Directory.GetCurrentDirectory()   @\Setting;

foreach(SHDocVw.InternetExplorer window in new SHDocVwShellWindows())
{
if(Path.GetFileNameWithoutExtension(window.FullName) == dir)
{
window.width = 300;
window.height = 300;
}

CodePudding user response:

The code below could only return the file name of the specified path string without extension. Hence, if you are using the code to open the window explorer, it would only return "explorer".

Path.GetFileNameWithoutExtension(window.FullName) 

Suggested code

Process.Start(Directory.GetCurrentDirectory()   @\Setting);
string dir = Directory.GetCurrentDirectory()   @\Setting;

foreach(SHDocVw.InternetExplorer window in new SHDocVwShellWindows())
{
if(Path.GetFullPath(window.FullName) == dir)
{
window.width = 300;
window.height = 300;
}
}

  • Related