[英]remote desktop application with wrongly displayed buttons
I have a winform within a remote desktop application that is built dynamically with a container panel for a toolbar with large (regular) buttons. 我在远程桌面应用程序中有一个winform,该应用程序是使用带有大(常规)按钮的工具栏的容器面板动态构建的。 The application is writen in C# and .NET 4.0. 该应用程序是用C#和.NET 4.0编写的。 The application is viewed as it should only if I do not maximize the window (meaning restored view is fine). 仅当我没有最大化窗口时才应查看该应用程序(这意味着恢复的视图很好)。
Now, after RDP login - within most client computers - the application looks fine (even when we maximize and restoring). 现在,在大多数客户端计算机中,在RDP登录之后,该应用程序看起来正常(即使我们最大化和还原)。 Within low resolution client computers (800x600), the buttons on the toolbar are not displayed in the right position (such as in the 1024x768 clients). 在低分辨率客户端计算机(800x600)中,工具栏上的按钮未显示在正确的位置(例如在1024x768客户端中)。
I used double buffering and it didn't help... the problem may or may not be depended on the screen resolution (it can be memory issue or something). 我使用了双重缓冲,但并没有帮助...问题可能取决于屏幕分辨率(可能是内存问题或其他)。 It is not a problem of localization layout. 这不是本地化布局的问题。
The following image shows the Fine and Bad states: http://imgur.com/gO4UJ,v7O9K 下图显示了良好和不良状态: http : //imgur.com/gO4UJ,v7O9K
What can I do to resolve this issue? 我该怎么做才能解决这个问题?
OK, so in case anybody gets to this kind of case, this is the thing that made the issue: 好的,所以如果有人遇到这种情况,这就是问题所在:
In the form, there was an empty repaint override. 在窗体中,有一个空的重绘替代。 The programmer that created the form was overriding the repaint with an empty method (don't know why, I guess I'll ask my team for the business logic). 创建表单的程序员正在用一个空方法覆盖重绘(不知道为什么,我想我会向我的团队询问业务逻辑)。
How did I reproduce it in the development environment? 我如何在开发环境中复制它? Following Albin Sunnanbo's note, I ran the RDP application in minimized version during initialization, and I noticed that it occurs with large resolution clients also in this use case... So, I know repaint occurs while performing a window resize - and this made me suspicious about the method... 按照Albin Sunnanbo的说明,我在初始化过程中以最小化版本运行RDP应用程序,并且我注意到在这种用例中它也发生在大型客户端上...因此,我知道在执行窗口调整大小时会发生重绘-这使我怀疑该方法...
==> On a side note, I guess this is why inheritance is so bad, and going on to WPF is better. ==>顺便说一句,我想这就是为什么继承如此糟糕,而继续使用WPF更好的原因。 It took me 3 days to understand why this issue occurred. 我花了三天的时间来了解为什么会发生此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.