以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- listview的标题如何自适应 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=139858) |
-- 作者:rjh4078 -- 发布时间:2019/8/23 14:46:00 -- listview的标题如何自适应 生成的图表中 有些标题的字数太多 系统默认不显示 如何让所有文字都显示出来 并且自动适应大小 类似与表的autosize功能 代码如下 Dim lvw As WinForm.ListView = e.Form.Controls("ListView1") lvw.Groups.Clear() lvw.Rows.Clear() lvw.Images.Clear() lvw.View = ViewMode.LargeIcon For Each gp As String In DataTables("动态菜单").SQLGetValues("类别","","序号") Dim vg As WinForm.ListViewGroup = lvw.Groups.Add() \'增加分组 vg.Name = gp \'指定分组名称 vg.Text = gp Next Dim lst As List(of DataRow) lst=DataTables("动态菜单").SQLSelect("ico<>\'\'","","序号") If lst.count>0 Then For Each dr As DataRow In lst lvw.Images.Addimage(dr("标题"),dr("图标"), dr("ico")) \'\'lvw.Images.AddSmallImage(dr("级码"),dr("图标")) Dim r As WinForm.ListViewRow = lvw.Rows.Add() r.Text = dr("别名") r.ImageKey = dr("标题") r.Group=dr("类别") r.Font = New Font("微软雅黑",10, FontStyle.Regular) Next End If lvw.AutoResizeColumns 红色代码没有作用? |
-- 作者:有点蓝 -- 发布时间:2019/8/23 15:05:00 -- Dim lvw As WinForm.ListView = e.Form.Controls("ListView1") For Each c As WinForm.ListViewColumn In lvw.Columns c.AutoResize Next |