-- 作者:bagih
-- 发布时间:2015/9/6 14:09:00
-- LISTVIEW列标题,求教
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1") lvw.StopRedraw() \'停止绘制 lvw.Groups.Clear() \'清除原来的分组 lvw.Columns.Clear() \'清除原来的列 lvw.Rows.Clear() \'清除原来的行 lvw.Images.Clear() \'清除原来的图片 lvw.View = ViewMode.Details \'显示模式为详细信息 lvw.TitleSize = New Size(130,80) \'设置平铺区域大小 lvw.GridLines = True \'显示网格线 Dim cls() As String = {"第一列","第二列","第三列","第四列","第五列","第六列"} \'定义列名 Dim wds() As Integer = {100,80,80,180,100,80} \'定义列宽 For i As Integer = 0 To cls.Length - 1 \'增加列 Dim c As WinForm.ListViewColumn = lvw.Columns.Add() c.Name = cls(i) \'指定列名 c.Text = \'设置标题 \'===============================怎么给这个列指定新标题,多个不会写
c.Width = wds(i) \'指定列宽 Next
怎么定义每个列的新名称?谢谢
|
-- 作者:大红袍
-- 发布时间:2015/9/6 14:22:00
--
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1") lvw.StopRedraw() \'停止绘制 lvw.Groups.Clear() \'清除原来的分组 lvw.Columns.Clear() \'清除原来的列 lvw.Rows.Clear() \'清除原来的行 lvw.Images.Clear() \'清除原来的图片 lvw.View = ViewMode.Details \'显示模式为详细信息 lvw.TitleSize = New Size(130,80) \'设置平铺区域大小 lvw.GridLines = True \'显示网格线 Dim cls() As String = {"第一列","第二列","第三列","第四列","第五列","第六列"} \'定义列名 Dim cl_caps() As String = {"第一列","第二列","第三列","第四列","第五列","第六列"} \'定义列名 Dim wds() As Integer = {100,80,80,180,100,80} \'定义列宽 For i As Integer = 0 To cls.Length - 1 \'增加列 Dim c As WinForm.ListViewColumn = lvw.Columns.Add() c.Name = cls(i) \'指定列名 c.Text = cl_caps(i) \'设置标题 \'===============================怎么给这个列指定新标题,多个不会写 c.Width = wds(i) \'指定列宽 Next
|