Delphi - TEdit标签不显示(仅适用于Windows 7 / Vista) [英] Delphi - TEdit Labels are not displaying (Windows 7/Vista only)

查看:346
本文介绍了Delphi - TEdit标签不显示(仅适用于Windows 7 / Vista)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在其他表单上插入了很少的TEdit表单,但是直到我更改窗口大小后,它们的标签才会显示。这种情况只发生在Windows Vista / Windows 7上.Windows XP的所有内容都标有正确的标签。

我已经测试过repaint / refresh(只是TEdit /所有格式等),没有结果。

Delphi 7.



感谢您的回答

坏的版本



正确的版本



代码将很快添加:)

解决方案

我能够在我的项目中解决相同的问题。这似乎是一个绘画顺序问题。最终的解决方案是在帧显示不正确的情况下调用 frame.Refresh; 。但是,找出放置Refresh的正确位置有点棘手,我在尝试了几个地方之后发现了一个可以工作的地方。在我选择的方法中,在选择要在选项面板上显示哪个嵌套框架并物理显示嵌套框架的方法中,调用 frame.Refresh; on围绕没有正确绘制的标签的最内框架。在内部框架上调用刷新而不是整个窗口的框架似乎是关键。

在您展示的屏幕截图中,您看起来像是可能有类似的复杂框架设置,其中可能会在框架顶部显示框架,可能会在最初显示框架后动态更改。这似乎是首先会造成问题的设置,最初显示的框架似乎从来没有出现问题。

然而,有一点需要注意的是,如果窗口离开屏幕或重新调整大小,另一个窗口被拖动到其前面或鼠标悬停的按钮消失的是这些行为可能导致问题自发地重新出现。可能还有其他地方,比如在窗口大小调整等的特殊处理程序中,或者在定时器上定期调用帧的刷新,类似于针对ALT Key错误提及的一些解决方案。似乎在问题类型以及如何解决问题方面存在一些重叠,但并不完全相同(不管Alt键如何,这个错误似乎都会发生)。

I we got few TEdit forms inserted on another form, but their labels are not displaying until I change size of the window. This happens just on Windows Vista / Windows 7. Windows XP has everything labeled correctly.

Ive already tested repaint / refresh (just TEdit / all form etc.) with no result.

Delphi 7.

Thank you for your answer

bad version

Correct version

code will be added soon enough :)

解决方案

I was able to mostly resolve this same problem on my project. It seems to be a painting order problem. The solution ultimately was to call frame.Refresh; on the frame that was not displaying properly. But, figuring out the right place to put that Refresh was a little tricky, I tried several places before I found a spot that worked. Where it worked for me was, in the method where I choose which nested frame to show on the options panel, and physically display the nested frame, to call frame.Refresh; on the inner-most frame surrounding the labels that are not drawing properly. Calling refresh on the inner frame rather than the frame for the entire window seemed to be key.

From the screen-shots you are showing, you look like you probably have a similar complex setup of frames where there are likely to be frames displayed on top of frames, which may change dynamically after the frame is displayed initially. That seemed to be the setup that would create the problem in the first place, the initially shown frame never seemed to have problems.

One note, however, is if the window moves off the screen or is re-sized, another window is dragged in front of it, or mouse-over buttons that are disappearing is that these actions could cause the problem to re-appear spontaneously. There may be additional places, such as in a special handler for window resize, etc. or on a timer where you to call refresh on the frame periodically, similar to some of the solutions mentioned for the ALT Key bug. There seems to be some overlap in the type of problem and how to fix it but does not the exact same cause (this bug seems to happen regardless of the Alt key)

这篇关于Delphi - TEdit标签不显示(仅适用于Windows 7 / Vista)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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