在 VB6 中,如果我按下对话框Cancel上的Open File按钮,我的文件名仍会添加到我的列表框中。
例如:
Private Sub btnImportImage_Click()
DailogOpenFile.ShowOpen
If Trim$(txtEmailAttachment.Text) = "" Then
txtEmailAttachment.Text = DailogOpenFile.FileName
Else
txtEmailAttachment.Text = txtEmailAttachment.Text & ";" & DailogOpenFile.FileName
End If
End Sub
Run Code Online (Sandbox Code Playgroud) vb6 ×1