以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- treeview问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=83945) |
|
-- 作者:扶风 -- 发布时间:2016/4/20 9:15:00 -- treeview问题 此主题相关图片如下:截图目录树.png DataTables("SQL_wdjbxxb").Load DataTables("SQL_user").Load Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") Dim nd1 As WinForm.TreeNode Dim nd2 As WinForm.TreeNode Dim nd3 As WinForm.TreeNode Dim nd4 As WinForm.TreeNode Dim nd5 As WinForm.TreeNode Dim nd6 As WinForm.TreeNode Dim nd7 As WinForm.TreeNode nd1 = Tr.Nodes.Add("我的文档","我的文档","Folder.ico") nd2 = Tr.Nodes.Add("我的回收站","我的回收站","Folder.ico") nd3 = Tr.Nodes.Add("公有文档","公有文档","Folder.ico") nd4 = Tr.Nodes.Add("共享文档","共享文档","Folder.ico") nd4.Nodes.Add("按类型分类") nd4.Nodes.Add("按部门分类") nd4.Nodes.Add("按群组分类") nd5 = Tr.Nodes.Add("最近操作文档","最近操作文档","Folder.ico") nd6 = Tr.Nodes.Add("最近收到文档","最近收到文档","Folder.ico") nd7 = Tr.Nodes.Add("文档查询","文档查询","Folder.ico") 老师,这是现在的样子,,我希望在“类型分类”下建立1层子节点,按type来分;“部门分类”下建立2层子节点,按department|username来分;“群组分类”下建立2层子节点,按group|username来分,这些属性都是某一张表格里的列属性,请问如何实现。
|
|
-- 作者:大红袍 -- 发布时间:2016/4/20 9:27:00 -- 参考
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=60176&authorid=0&page=0&star=1
不会做,请上传实例啊。 |
|
-- 作者:扶风 -- 发布时间:2016/4/20 19:08:00 --
|
|
-- 作者:大红袍 -- 发布时间:2016/4/20 19:23:00 -- 如
nds(i+1) = nds(i).Nodes.Add(arys(i)) nds(i+1).IconFile = "d:\\test.ico"
如
nds(1) = nds(0).Nodes.Add(arys) nds(1).IconFile = "d:\\test.ico" |
|
-- 作者:扶风 -- 发布时间:2016/4/20 20:38:00 -- 老师,字节怎么换算,M G kb 字节 怎么写代码换算 |
|
-- 作者:大红袍 -- 发布时间:2016/4/20 20:42:00 -- 1G = 1024 M 1M = 1024 K 1K = 1024 B
FileInfo里面得到的是B |
|
-- 作者:扶风 -- 发布时间:2016/4/20 21:33:00 -- Dim w_type As String w_type = e.Form.Controls("ComboBox1").value Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog dlg.Filter="Excel文件|*.xls|Word文件|*.doc|Access文件|*.mdb|图档|*.bmp;*.jpg;*.gif|文本文件|*.txt" \'设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮 MessageBox.Show("您已选择了1份文档,这些文档将被导入到万盛文管服务器,在导入之前,您可能需要设置这些文档的类型以及共享权限!","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) End If Dim lujing = dlg.FileName Dim ifo As new FileInfo(lujing) Dim w_CreationTime As String Dim w_LastWriteTime As String Dim w_LastAccessTime As String Dim w_ReadOnly As String Dim w_Hidden As String Dim w_Path As String Dim w_Length As String Dim w_Name As String Dim w_Extension As String w_CreationTime = ifo.CreationTime w_LastWriteTime = ifo.LastWriteTime w_LastAccessTime = ifo.LastAccessTime w_ReadOnly = ifo.ReadOnly w_Hidden = ifo.Hidden w_Path = ifo.Path w_Length = ifo.Length w_Name = ifo.Name w_Extension = ifo.Extension Dim W_L As String Select Case w_Length Case w_Length<1024 W_L = w_Length+"KB" Case 1024<=w_Length<1048576 W_L = w_Length/1024+"MB" Case Else W_L = w_Length/1048576+"GB" End Select With MainTable Dim cmd As New SQLCommand cmd.C cmd.CommandText = "Insert Into {wdjbxxb} ([wdmc],[wdlx],[wddx],[cjsj],[xgsj]) Values (\'" cmd.CommandText = cmd.CommandText & w_Name & "\',\'" & w_type & "\',\'" & w_Length & "\',\'" & w_CreationTime & "\',\'" & w_LastWriteTime & "\')" cmd.ExecuteNonQuery DataTables("SQL_wdjbxxb").Save() Tables("SQL_wdjbxxb").Current.Load() End With 老师,出现问题1:“从字符串“GB”到类型“Double”的转换无效。 去掉GB那段代码的转化 出现问题2:“未将对象引用到实例化“ 但内容已经填到数据库字段里
|
|
-- 作者:大红袍 -- 发布时间:2016/4/20 21:37:00 -- 存放的时候,为什么要存放 xxxGB 这样?如果确实要存放,你就要用字符类型的列 |
|
-- 作者:扶风 -- 发布时间:2016/4/21 12:06:00 -- 老师,好的谢谢,属性我们可以出来了;
但是我们想进一步完善一下,上列中如何做到设置指定节点的属性(图标、标题等等)。 谢谢!
[此贴子已经被作者于2016/4/21 12:07:45编辑过]
|
|
-- 作者:大红袍 -- 发布时间:2016/4/21 12:09:00 -- 看不懂你想问什么
nds(i+1).IconFile = "d:\\test.ico" nds(i+1).Text = "aabbcc"
http://www.foxtable.com/help/topics/0895.htm
|