简体   繁体   中英

Set Height, Width the popup window explorer

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;
}

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;
}
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM