设置Screen.WorkingArea.Width?

发布于 2024-08-19 16:44:05 字数 309 浏览 3 评论 0原文

抱歉,如果这是一个基本问题,我只是愚蠢:)

我正在构建一个侧边栏应用程序,它使用 System.Windows.Forms.Screen.PrimaryScreen.WorkingArea 来设置适当的宽度、高度和位置。

我现在想减少桌面的工作区域,以便当表单最大化时,仍然显示侧边栏(与 Vista 或 Google 侧边栏的方式相同)...但尝试在workingArea.Width 属性上设置宽度给我一个关于工作区域(System.Drawing.Rectangle)不是属性的错误。

我该如何更改工作区域的宽度以防止表单与侧边栏重叠? 提前致谢!

Sorry if this is a fundamental question and I'm just stupid :)

I am building a sidebar application, it uses System.Windows.Forms.Screen.PrimaryScreen.WorkingArea to set the appropriate widths and heights and locations.

I want to now reduce the working area of the desktop so that when forms maximise, the sidebar is still shown (in the same way that the Vista or Google sidebars do)... but trying to set the Width on the WorkingArea.Width property gives me an error about the WorkingArea (a System.Drawing.Rectangle) not being a property.

What can I do to change the width of the WorkingArea to prevent forms overlapping my sidebar?
Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

权谋诡计 2024-08-26 16:44:05

实际上,更详细地看一下,它看起来涉及更多,并且需要 Win32 API 调用来完成工作并获得完全相同的行为。

此链接包含一些有关如何完成它。 (抱歉,是 ExpertsExchange,所以请向下滚动,但它是完整的示例。)

Actually looking at this in more detail, it looks like it is much more involved and requires Win32 API calls to get the job done and get the exact same behavior.

This link contains some sample code on how to get it done. (Sorry, its ExpertsExchange, so scroll down, but it is a full sample.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文