当存在组时,列表视图控件绘制不正确
我正在尝试使用列表视图组,结果发现应用程序启动时控件显示不正确。
一旦我调整表单大小,它就会正确显示:
我不明白发生了什么。谁能解释一下吗?
I was experimenting with list view groups, and it turns out the control displays incorrectly when the application starts.
As soon as I resize the form it displays correctly:
I do not understand what is happening. Can anyone explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我重现的 Delphi 控件中的一个错误。我还不确定是什么原因导致了这个错误。我已将其提交给 Quality Central,名称为 QC#101104。
我找到了一个简单的解决方法,将以下代码添加到表单的
OnShow
事件中。下面的 DFM 文件足以说明该问题:
事实证明,解决该问题的另一种方法是移动 DFM 文件中的
ViewStyle
条目,使其出现在Items条目。因此,解决该问题的另一个方法是在运行时添加项目。事实上,这可能解释了为什么这个错误还没有被发现,因为我打赌绝大多数列表视图代码在运行时添加了项目。
It's a bug in the Delphi control which I have reproduced. I'm not sure yet what causes the bug. I have submitted this to Quality Central as QC#101104.
I found a simple workaround by adding the following code to the form's
OnShow
event.The following DFM file is enough to demonstrate the problem:
It turns out that another way to resolve the problem is to move the
ViewStyle
entry in the DFM file so that it appears before theItems
entry. So yet another workaround for the problem would be to add the items at runtime. In fact this probably explains why this bug has not been found since I bet that the overwhelming majority of list view code adds the items at runtime.