我有一个包含列表框 (listbox1) 的用户控件。
水平滚动条设置设置为 TRUE。
另一个列表框 (selectionchanged) 上还有一个处理程序,用于设置 listbox1 的值(以防这可能导致问题)。
我将此用户控件添加到选项卡控件中的选项卡页。
我面临的问题是,即使 listbox1 中显示的项目大于宽度,也不会显示水平滚动条。
任何人都知道我该如何解决这个问题?
谢谢
- 编辑 - 尽可能多的代码,我可以显示
dim tabpage as new Tabpage
dim dict as new dictionary(of String, list(of MyObject))
'fill dict
tabpage.add(usercontrol(dict))
tabcontrol1.tabpages.add(tabpage)
用户控制:
class UserControl
public sub new(dict)
Dim bs As BindingSource = New BindingSource(dict, Nothing)
ListBox1.DataSource = bs
ListBox1.DisplayMember = "Key"
end sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
ListBox2.DataSource = New BindingSource(CType(ListBox1.SelectedItem, KeyValuePair(Of String, List(Of MyObject))).Value, Nothing)
End Sub
End Class