如何隐藏树列表项中的所有列?
我使用 HyperTreeList
显示第一列中具有名称的项目列表,第二列中显示“删除”按钮。我编写了一个函数,通过 TextCtrl
中的某些文本来过滤树中显示的内容。为了隐藏 TreeListItems
,我这样做:
treelist.HideItem(branch, True)
其中 treelist 是 HyperTreeList
,branch 是 TreeListItem
。第一列隐藏得很好,但第二列中的按钮都没有隐藏。如何隐藏 TreeListItem
中的所有列?
I'm using the HyperTreeList
to display a list of items with the name in the first column, and a "Remove" button in the second column. I wrote a function to filter what is displayed in the tree by some text in a TextCtrl
. To hide the TreeListItems
, I'm doing this:
treelist.HideItem(branch, True)
where treelist is a HyperTreeList
and branch is a TreeListItem
. The first column hides just fine, but none of the buttons in the second column hide. How do I get all columns in a TreeListItem
to hide?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 文档,这应该有效:
但这会隐藏该列的所有内容。如果我明白你在说什么,你试图隐藏的行实际上并没有消失,只是第一列的值消失了。在这种情况下,您可能必须使用
treelist.Update()
刷新小部件才能使该行的其余部分消失。According to the docs, this should work:
but this will hide that column for everything. If I understand what you're saying, the row you are trying to hide doesn't actually disappear, just the value of the first column. In that case, you might have to refresh the widget with
treelist.Update()
to get the rest of the row to disappear.