关于VB.NET选择打开文件的问题,请帮我看一下什么地方错了?谢谢

游子 游子 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Private Function SelectFile(ByVal filters As String, ByVal actioncode As Integer) As Boolean
Dim s As String
s = Mid(filters, InStrRev(filters, "|") + 1)
On Error Resume Next
With CommonDialog1Open
.Filter = filters
.FileName = s
.AddExtension = actioncode
If Err.Number = 0 Then
SelectFile = True
End If
End With
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If SelectFile("lab (*.xls)|*.xls", 1) Then
TextBox1.Text = CommonDialog1Open.FileName
End If
End Sub
为什么点浏览按钮后TextBox1就出现*.xls??
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
游子
VB 16,718 成员 110,520 内容