以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]LISTVIE显示  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=69501)

--  作者:seal51
--  发布时间:2015/6/6 10:29:00
--  [求助]LISTVIE显示


图片点击可在新窗口打开查看此主题相关图片如下:listview512.png
图片点击可在新窗口打开查看

 

代码如下, 如何更改呢?

Dim lvw As WinForm.ListView = Forms("FTP生产图纸管理器").Controls("ListView1")
\'lvw.Columns.Clear() \'清除原来的列
lvw.Rows.Clear
lvw.Images.Clear
lvw.Images.LargeSize = new size(32,32)

 

Dim  ics As String() = {"swf","accdb","mdb","psd","png","xls","xlsx","bmp","rar","jpg","doc","docx","zip","pdf","txt","ppt","exe","dwg","other"}  \'定义扩展名数组
Dim kzms As String ="swf accdb mdb psd png xls xlsx bmp rar jpg doc docx zip pdf txt ppt dwg exe"  \'定义已知扩展名的文本串
For Each ic As String In ics
    lvw.Images.AddImage(ic,ic & ".png",ic & ".png")  \'向listview里添加图标
Next
\'==============================以上是设置listview的代码============================

\'==============================以下是生成listview的代码============================

Dim sts As List(of String) = ftp.GetFileList(fp)
If sts.Count > 0 Then  \'若有文件
    For Each st As String In sts
        Dim r As WinForm.ListViewRow = lvw.Rows.Add   \'增加一行
        Dim Dot As Integer = st.LastIndexOf(".")  \'定义.的位置
        Dim kzm As String = st.SubString(Dot + 1)   \'获取扩展名
        r.text = st
        If kzms.Contains(kzm) = True Then   \'若为已知扩展名
            r.ImageKey = kzm  \'指定行的图标键值
        Else
            r.ImageKey = "other"
        End If
    Next
End If


 


--  作者:Bin
--  发布时间:2015/6/6 10:34:00
--  
做不到的哦.除非用这种http://www.foxtable.com/help/topics/2771.htm
--  作者:Bin
--  发布时间:2015/6/6 10:35:00
--  
或者是调整LIstVIew宽度小一点. 一行装不下2个.自然就垂直排列
--  作者:seal51
--  发布时间:2015/6/6 10:52:00
--  
谢谢老师