vb中listview的列表格式里面的列名怎么设置
如图:我把listview控件设置为checkboxes=True'带选择框的列表样式我想设置列名怎么设置啊?请高手指教</img>...
如图:我把listview控件设置为checkboxes=True '带选择框的列表样式
我想设置列名 怎么设置啊? 请高手指教 </img> 展开
我想设置列名 怎么设置啊? 请高手指教 </img> 展开
推荐于2018-05-06
展开全部
д孤雁亦孇飞 说的对
ListView的View必须是lvwReport才能显示表头。
下面给你段ListView的操作代码
你往窗体上画两个按钮,一个ListView
Dim i As Long
Private Sub Command1_Click()
ListView1.ColumnHeaders.Add , , "第 " & ListView1.ColumnHeaders.Count + 1 & "项"
For i = 0 To ListView1.ColumnHeaders.Count - 1
ListView1.ColumnHeaders(i + 1).Width = (ListView1.Width - 100) / ListView1.ColumnHeaders.Count
Next
End Sub
Private Sub Command2_Click()
ListView1.ListItems.Add , , "第 " & ListView1.ListItems.Count + 1 & "表"
For i = 1 To ListView1.ColumnHeaders.Count - 1
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , i
Next
End Sub
Private Sub Command3_Click()
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End Sub
Private Sub Form_Load()
ListView1.LabelEdit = lvwAutomatic
ListView1.View = lvwReport
Me.Move Left, Top, 5775, 5205
ListView1.Move 0, 0, Me.Width - 130, Me.Height - 1200
Command1.Move 720, 4000, 1095, 375
Command2.Move 2160, 4000, 1095, 375
Command3.Move 3600, 4000, 1095, 375
Command1.Caption = "添加项"
Command2.Caption = "添加表"
Command3.Caption = "删除选定表"
End Sub 答案补充 ~~~错了,三个按钮。。。
ListView的View必须是lvwReport才能显示表头。
下面给你段ListView的操作代码
你往窗体上画两个按钮,一个ListView
Dim i As Long
Private Sub Command1_Click()
ListView1.ColumnHeaders.Add , , "第 " & ListView1.ColumnHeaders.Count + 1 & "项"
For i = 0 To ListView1.ColumnHeaders.Count - 1
ListView1.ColumnHeaders(i + 1).Width = (ListView1.Width - 100) / ListView1.ColumnHeaders.Count
Next
End Sub
Private Sub Command2_Click()
ListView1.ListItems.Add , , "第 " & ListView1.ListItems.Count + 1 & "表"
For i = 1 To ListView1.ColumnHeaders.Count - 1
ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , i
Next
End Sub
Private Sub Command3_Click()
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End Sub
Private Sub Form_Load()
ListView1.LabelEdit = lvwAutomatic
ListView1.View = lvwReport
Me.Move Left, Top, 5775, 5205
ListView1.Move 0, 0, Me.Width - 130, Me.Height - 1200
Command1.Move 720, 4000, 1095, 375
Command2.Move 2160, 4000, 1095, 375
Command3.Move 3600, 4000, 1095, 375
Command1.Caption = "添加项"
Command2.Caption = "添加表"
Command3.Caption = "删除选定表"
End Sub 答案补充 ~~~错了,三个按钮。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |