7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub CmdAdd_Click()
With CommonDialog1
.InitDir = App.Path & "\data\0606"
.DialogTitle = "打开"
.CancelError = False
'ToDo: 设置 common dialog 控件的标志和属性
.Filter = "所有文件 (*.*) |*.*"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
End With
Dim i As Long, n As Long
n = Text2.UBound
If n = 5 Then MsgBox "注意,最多添加6个文件"
If n > 5 Then Exit Sub '最多添加6个附件
Load Text2(Text2.Count)
Load cmdCls(cmdCls.Count)
Text2(Text2.Count - 1).Text = CommonDialog1.filename
Text2(Text2.Count - 1).Top = Text2(Text2.Count - 2).Top + Text2(0).Height
Text2(Text2.Count - 1).Left = Text2(0).Left
Text2(Text2.Count - 1).Visible = True
cmdCls(cmdCls.Count - 1).Top = cmdCls(cmdCls.Count - 2).Top + cmdCls(0).Height
cmdCls(cmdCls.Count - 1).Left = cmdCls(0).Left
cmdCls(cmdCls.Count - 1).Visible = True
End Sub
Private Sub Cmdcls_Click(Index As Integer)
Text2(Index).Text = ""
For i = Index To Text2.Count - 2
Text2(i).Text = Text2(i + 1).Text
Next
Unload Text2(Text2.Count - 1)
Unload cmdCls(cmdCls.Count - 1)
End Sub