我有一个 ListCtrl,它显示供用户选择的项目列表。这很好用,除了当 ctrl 不够大以显示所有项目时,我希望它使用垂直 scoll 条向下扩展,而不是在向右扩展时使用水平滚动条。
ListCtrl 的创建:
self.subjectList = wx.ListCtrl(self, self.ID_SUBJECT, style = wx.LC_LIST | wx.LC_SINGLE_SEL | wx.LC_VRULES)
使用 wx.ListItem 插入项目:
item = wx.ListItem()
item.SetText(subject)
item.SetData(id)
item.SetWidth(200)
self.subjectList.InsertItem(item)