ListView1.BorderStyle = ccFixedSingle;边界类型
ListView1.SmallIcons = ImageList1 ;
关联图标仓库ImageList1
For Counter = 0 To File1.ListCount - 1
Fname = File1.List(Counter);
获取当前目录下符合条件的文件名
Set itmX = ListView1.ListItems.Add(, , Fname)’文件名称栏目
itmX.SubItems(1) = CStr(Counter + 1) +
"/" + CStr(File1.ListCount)’文件在列表框位置
itmX.SubItems(2) = CStr(FileLen(Fname));'文件长度
itmX.SmallIcon = 1;'列表项目图标
itmX.SubItems(3) = Format(FileDateTime(Fname),"hh:mm yyyy/MMMM/dd");'文件创建时间
Next Counter
ListView1.View = lvwReport;报表类型
ListView1.Arrange = 0
ListView1.LabelWrap = False
Dir1.ToolTipText = "当前目录是:" & Dir1.Path
END SUB
双击驱动器列表框,输入以下代码:
Private Static Sub Drive1_Change()
On Error GoTo IFerr;拦截错误
Dir1.Path = Drive1.Drive;关联目录列表框
Exit Sub
IFerr:;如果磁盘错误
MsgBox "请确认驱动器是否准备好或者磁盘已经不可用!"
Drive1.Drive=Dir1.Path;忽略驱动器改变
End Sub
双击目录列表框,输入以下代码:
Private Static Sub Dir1_Change()
File1.Path = Dir1.Path;关联文件列表框
If Right(Dir1.Path, 1) < > "\" Then
CurrentDir = Dir1.Path & "\"
Else
上一页 [1] [2] [3] 下一页
|