|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 zhangxueliang 于 2017-9-4 14:31 编辑
- <blockquote>Private Sub TextBox2_Click(sender As Object, e As EventArgs) Handles TextBox2.Click
复制代码 以上代码是点击文本框,能选择EXCEL中的任意单元格,并且返回该单元格的地址
- Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles TextBox1.Click
- If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
- TextBox1.Text = FolderBrowserDialog1.SelectedPath
- TextBox1.SelectionStart = TextBox1.Text.Length
- Dim FileNames() As String
- FileNames = Directory.GetFiles(TextBox1.Text)
- For i As Integer = 0 To FileNames.Length - 1
- ListBox1.Items.Add(Path.GetFileName(FileNames(i)))
- Next
- End If
- End Sub
复制代码 以上代码是点击Textbox1文本框,返回路径
http://club.excelhome.net/thread-1335976-1-1.html
|
|