以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 急求教ListBox控件的问题, (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=17600) |
-- 作者:kevin -- 发布时间:2012/3/17 23:31:00 -- 急求教ListBox控件的问题, 用用以下代码实现在 ListBox1 控件中显示指定路径下的所有文件名称;该显示的文件都是word文档 我想,点击 ListBox1 控件中的每一个文件名时,能够在WebBrowser控件中显示出来.请问应该如何写这个事件代码? Dim Cmb As WinForm.ListBox = e.Form.Controls("ListBox1") For Each File As String In FileSys.GetFiles("D:\\Word") dim i as integer = file.lastindexof("\\") Cmb.Items.Add(file.substring(i + 1, file.lastindexof(".") - i - 1)) Next |
-- 作者:czy -- 发布时间:2012/3/18 12:13:00 -- 不知道你想问什么? |
-- 作者:kevin -- 发布时间:2012/3/18 14:01:00 -- CZY老师你好! 用用以下代码实现在 ListBox1 控件中显示指定路径下的所有文件名称;(该显示的文件都是word文档) Dim Cmb As WinForm.ListBox = e.Form.Controls("ListBox1") For Each File As String In FileSys.GetFiles("D:\\Word") dim i as integer = file.lastindexof("\\") Cmb.Items.Add(file.substring(i + 1, file.lastindexof(".") - i - 1)) Next 当点击 ListBox1 控件中显示的每一个文件名时,将内容在同一窗体 WebBrowser 控件中,将文档内容显示出来. 请问应该如何写这个事件代码? |
-- 作者:czy -- 发布时间:2012/3/18 18:07:00 -- 那你在该控件的SelectedIndexChanged事件中设置以下代码就可以了
|