作为activeX控件的菜鸟,我设法在MS-access 2019表单上启动并运行ListView
(v6)。
我对实现它的方式并不熟悉和笨拙,并且我真的不知道要使用什么文档(与许多选项,.NET CORE,.NET Framework 4.8等混淆)。感谢有人可以将我指向网络上的资源!
现在,我想将组添加到ListView
中,但不知道该怎么做。我发现显然不是VBA的示例,并尝试翻译这些示例,但是失败了。
同样可以使字体变大。
我的代码来设置示例数据并填充ListView
:
Dim oListView As ListView
Private Sub Form_Load()
Dim oListItem As ListItem
Dim n As Integer
Set oListView = Me.lvwTest.Object
oListView.Font.Size = 12
For n = 1 To 4
Set oListItem = oListView.ListItems.Add(,"a" & n,n)
oListItem.ListSubItems.Add,"Foo " & n
oListItem.ListSubItems.Add,"Bar " & n
Next
End Sub
修改
为什么ListView
:
我有一个服务列表,这些服务都链接到特定日期,例如
------------------------------------------
01/28/2020 [-]
------------------------------------------
double room 1 58.00 €
breakfast 2 16.00 €
------------------------------------------
01/29/2020 [-]
------------------------------------------
double room - tuesday special 1 52.00 €
breakfast 2 16.00 €
dinner 2 26.00 €
foo 2 12.00 €
bar 1 4.60 €
------------------------------------------
01/30/2020 etc. etc. [-]
------------------------------------------
ListView
可以右对齐€列,并且-我认为可以-添加组(日期)。我想通过单击组标题来扩展/隐藏每个组的行。