是否有可能改变最小化窗口的大小在MDI C#的WinForms [英] Is it possible to change size of minimized window in MDI C# Winforms

查看:198
本文介绍了是否有可能改变最小化窗口的大小在MDI C#的WinForms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


用户抱怨说,当他们在MDI容器数最小化的窗口,这是不可能区分它们,除非他们resore每个。我不知道是否有可能使最小化的窗口有点宽,以便在标题的文本可以包含6个字符?
在此先感谢!


Users complain that when they have several minimized windows in MDI container it's impossible to distinguish them unless they resore each. I wonder if it's possible to make minimized window a little bit wider so the text in the caption can contain 6 characters?
Thanks in advance!

推荐答案

不,这是不可能的。 Windows确定一个最小化的窗口使用当前的系统参数的宽度,而且也没有办法动态地改变这种单个应用程序,而不在整个系统中更改值。

No, this is not possible. Windows determines the width of a minimized window using the current system parameters, and there's no way to change this dynamically for a single application without changing the values across the entire system.

具体而言,所有的最小化窗口的默认大小为160x31。在MDI应用程序,你居然能看到这种规模,因为窗口是最小化到其MDI的主机,而不是进入Windows任务栏上。雷蒙德·陈(在Windows Shell中的团队在微软开发者)发表了几个博客的条目而回这解释了为什么这个特殊的尺寸选择,这意味着什么。首先是可以在这里找到:为什么最小化的窗口有160x31的外观尺寸而第二个后续条目都可以在这里找到:没有,真的,为什么160x31 他解释说在第二个职位:

Specifically, the default size of all minimized windows is 160x31. In a MDI application, you actually get to see this size because the window is minimized into its MDI host, rather than into the Windows taskbar. Raymond Chen (a developer on the Windows Shell team at Microsoft) published a couple of blog entries a while back that explain why this particular size was chosen, and what it means. The first is available here: Why do minimized windows have an apparent size of 160x31? And the second follow-up entry can be read here: No, really, why is it 160x31? As he explains in that second post:

微型标题栏的宽度由 MINIMIZEDMETRICS 结构的 iWidth 成员决定。你可以检索和改变这个结构与 SystemParametersInfo 函数的帮助。 (使用 SPI_GETMINIMIZEDMETRICS SPI_SETMINIMIZEDMETRICS 标记,分别)。有些人会提到了minWidth 注册表值,但这些人是错误的。请注意,例如,与了minWidth 搞乱需要注销周期,而使用 SPI_SETMINIMIZEDMETRICS 立即生效。这是因为 SPI_SETMINIMIZEDMETRICS 更新内部状态变量,而重击注册表只是改变的值在数据库中,没有人关注,一旦你登录的。

The width of the miniature title bar is determined by the iWidth member of MINIMIZEDMETRICS structure. You can retrieve and change this structure with the help of the SystemParametersInfo function. (Use the SPI_GETMINIMIZEDMETRICS and SPI_SETMINIMIZEDMETRICS flags, respectively.) Some people will mention the MinWidth registry value, but those people are wrong. Notice, for example, that messing with MinWidth requires a logoff cycle, whereas using SPI_SETMINIMIZEDMETRICS takes effect immediately. That's because SPI_SETMINIMIZEDMETRICS updates the internal state variables, whereas whacking the registry just change a value in a database that nobody pays attention to once you've logged on.

怎么样的高度?这是一个标题栏,您可以从显示控制面板的外观选项卡调整只是高度。 (以编程方式,您可以使用有益 SystemParametersInfo 功能,采用的 iCaptionHeight 成员这一次> NONCLIENTMETRICS 结构。)

What about the height? That's just the height of a caption bar, which you can adjust from the Appearance tab of the Display control panel. (Programmatically, you can use that helpful SystemParametersInfo function, this time using the iCaptionHeight member of the NONCLIENTMETRICS structure.)


因为我怀疑你的用户真的想你搞乱他们的系统默认参数为P /调用 SystemParametersInfo 功能,你是不是留下了一大堆的选项。我的建议,特别是如果他们正在与一个窗口的时间和离开其余最小化,是切换到其他界面。 MDI的目的是为了让用户平铺或层叠多个窗口,使他们能够看到多个在同一时间。因为它听起来像,这不是典型的使用情况下,你可能都能够更好地切换到使用标签,而不是应用程序服务。这通常被称为一个选项卡式文档界面(TDI),一个较为现代化的实现旧的多文档接口(MDI)的。它已经成为很受欢迎,多年来,检查出的维基百科的文章


Since I doubt your users really want you messing with their default system parameters by P/Invoking the SystemParametersInfo function, you aren't left with a whole lot of options. My recommendation, especially if they're working with a single window at a time and leaving the others minimized, is to switch to an alternative interface. The intention of MDI was to allow users to tile or cascade multiple windows so that they could see more than one at a time. Since it sounds like that's not the typical use case, you might both be better served by switching the application to use tabs instead. This is often called a tabbed document interface (TDI), a somewhat more modern implementation of the old multiple document interface (MDI). It's become quite popular over the years; check out the Wikipedia article.

这篇关于是否有可能改变最小化窗口的大小在MDI C#的WinForms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆