简体   繁体   English

确保wxListCtrl中的列可见性

[英]Ensuring column visibility in wxListCtrl

I want wxListCtrl in report mode and I want to lock one or more columns such that when you scroll left and right those columns remain visible at all times. 我希望wxListCtrl处于报告模式,并且我想锁定一个或多个列,以便在左右滚动时,这些列始终保持可见。 For example: 例如:

| | name | 名称| field1 | field1 | field2 | field2 | field3 |....| field3 | .... |

When scrolled to the left I want it to be like: 当向左滚动时,我希望它像:

| | name | 名称| field3 | field3 | field 4 | 栏位4 | ... | ... |

I can't find a way to get this functionality. 我找不到获得此功能的方法。

I looked at wxGrid and it would if I set the row label to the name value, but first that's not exactly what is desired and second it makes the name non-editable. 我查看了wxGrid,如果我将行标签设置为名称值,那会是不正确的,其次,它会使名称不可编辑。 I need it to be editable. 我需要它是可编辑的。

There a way to get what I want? 有没有办法得到我想要的?

I suggest faking it by using two controls side by side. 我建议并排使用两个控件来伪造它。 One would hold the the non-scrolling column(s), the other would scroll. 一个将保留非滚动列,另一个将滚动。 By carefully aligning them with minimal margins, they would look, at a glance, like one control. 通过以最小的边距仔细对齐它们,它们一眼便会看起来像一个控件。 By handling the vertical scroll events in the parent, the vertical scrolling of both can be synchronized. 通过处理父级中的垂直滚动事件,可以同步两者的垂直滚动。

I would definitely use wxGrid rather than wxListCtrl since you get access to a much richer feature set. 我绝对会使用wxGrid而不是wxListCtrl,因为您可以访问功能更丰富的功能集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM