Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 如何使用SetWindowPos定位窗口?_.net - Fatal编程技术网

.net 如何使用SetWindowPos定位窗口?

.net 如何使用SetWindowPos定位窗口?,.net,.net,我使用下面的代码在Excel工作区旁边显示一个新窗口。一切正常,但我希望新窗户在左边。我尝试在SetWindowPos中更改X,但它仍然在右侧加载。有人能帮忙吗 SafeNativeMethods.SetWindowPos(this.SiblingWindow, IntPtr.Zero, 0, 0, newWidth, siblingRect.Height, SafeNativeMethods.SWP_NOMOVE | SafeNativeMethods.SWP_NOZORDER); 在哪里

我使用下面的代码在Excel工作区旁边显示一个新窗口。一切正常,但我希望新窗户在左边。我尝试在SetWindowPos中更改X,但它仍然在右侧加载。有人能帮忙吗

SafeNativeMethods.SetWindowPos(this.SiblingWindow, IntPtr.Zero, 0, 0, newWidth, siblingRect.Height, SafeNativeMethods.SWP_NOMOVE | SafeNativeMethods.SWP_NOZORDER);
在哪里

  • this.SiblingWindow是Excel工作区的句柄
  • newWidth=Excel工作区.Width-新窗口.Width

  • 否,Excel将控制其子窗口的排列。很不清楚这个灰色面板最初是如何创建的,但是你能在左边看到它的几率并不高。不,Excel可以控制它的子窗口的排列。很不清楚那块灰色面板最初是如何产生的,但你能在左边看到它的几率不大。