使用 Infragistics 组件和调整例程大小时,Winforms 应用程序在不同计算机上的显示不同

发布于 2024-12-06 19:58:39 字数 382 浏览 7 评论 0原文

我正在使用 Winforms 开发 GUI。在大多数测试计算机上,一切看起来都很好(例如,UI 以相同的方式显示,并根据开发 GUI 的计算机而显示)。但是,在一台笔记本电脑上,可能会出现多个元素无法正确显示的情况(尺寸错误或重绘时出现问题)。

我已经没有足够的测试来找出我们可能出错的地方;所有计算机都在不同的屏幕分辨率下运行 Windows 7。

我正在使用 Infragistics 组件来构建 UI。有什么想法吗?

编辑:一些例子。在“损坏的”笔记本电脑上,某些选项卡(UltraWinTab 的一部分)在最小化/恢复命令后无效且不会重新绘制,您只能看到选项卡的背景,而没有任何组件。

其他一些控件莫名其妙地以小得多的尺寸绘制(我没有填充该区域,而是得到了大的空底部和右侧带)。

I am developing a GUI using Winforms. Everything looks fine on the majority of testing computers (as in, the UI is displayed in the same way and accordingly to the pc on which the GUI was developed). On a single laptop, though, it happens that several elements are not displayed correctly (wrong sizes, or problems in redrawing).

I am running out of tests to figure out what could possibly we wrong; all the computers run Windows 7 on various screen resolutions.

I am using Infragistics components to build the UI. Any thoughts?

edit: some examples. On the "broken" laptop, some tabs (part of an UltraWinTab) are invalidated and not redrawn after a minimize/restore command, you get only the background of the tab but no components.

Some other controls are inexplicably drawn at a much smaller size (instead of filling the area, I get big empty bottom and right bands).

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

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

发布评论

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

评论(1

情深如许 2024-12-13 19:58:39

我们也遇到过这方面的问题。具有 Infragistics 控件的 Windows.Forms 应用程序在 Windows XP 上看起来不错,但在 W7 上开始出现各种大小调整问题。我花了很长时间才弄清楚发生了什么事。

当然,首先我认为这与 Infragistics 有关,但我在任何论坛上都没有找到任何线索。最后我偶然发现了 此链接,其中解释了超出特定嵌套控件层次结构、调整大小事件不再触发。

我们有一个 UI 框架,对我们来说,使用此覆盖创建 System.Windows.Forms.SplitContainer 的派生就足够了:

// HACK: under Windows7, controls do not always redraw to their whole rectangle after restoring their size.
protected override void OnSizeChanged(EventArgs e)
{
    if (Handle != null) // Can be null because the event is invoked before the handle is created.
        BeginInvoke((MethodInvoker)(() => base.OnSizeChanged(e)));
}

因为我们在 SplitContainer 上有 Infragistics 控件(网格、停靠管理器)。也许 Infragistics 控件具有很深的嵌套级别,使得这种情况比其他控件更快发生。

We've had issues with this as well. A Windows.Forms application with Infragistics controls looked good on Windows XP, but on W7 all kinds of resizing issues started to occur. It took me ages to find out what happened.

Of course, first I assumed it had to do with Infragistics, but I just didn't find a clue anywhere on any forum. At last I stumbled upon this link, where it was explained that beyond a certain nesting hierarchy of controls, resizing events are no longer fired.

We have a UI framework and for us it was sufficient to make a derivative of System.Windows.Forms.SplitContainer with this override:

// HACK: under Windows7, controls do not always redraw to their whole rectangle after restoring their size.
protected override void OnSizeChanged(EventArgs e)
{
    if (Handle != null) // Can be null because the event is invoked before the handle is created.
        BeginInvoke((MethodInvoker)(() => base.OnSizeChanged(e)));
}

Because we have Infragistics controls (grid, dock manager) on SplitContainers. Maybe Infragistics controls have a deep nesting level, making this happen sooner than with other controls.

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