我正在使用列表框在word中的userforms中显示数据。但是,我无法设置标题标题或弄清楚如何使单击标题以按该列排序。
GUI.Search_ListBox.Clear
GUI.Search_ListBox.ColumnCount = 5 ' Columns
GUI.Search_ListBox.ColumnWidths = "120;80;70;120;300"
GUI.Search_ListBox.ColumnHeads = True
'GUI.Search_ListBox.RowSource = "Hello;gkjfl;hsjgh;hdfjhgkj;fdjghjkdf" 'here it fails!!!
使用VBA,只需将ListBox.ColumnHeads
属性设置为True
。
或者,您也可以在ActiveX控件的Properties
对话框中更改设置:
如果功能区上的按钮被禁用,则必须先输入。
您需要在rowsource中指定标题:
列标题已启用,字段标题,字段名称或第一行数据项用作列标题。