Foxtable(狐表)用户栏目专家坐堂 → 这段代码有啥问题?


  共有2449人关注过本帖平板打印复制链接

主题:这段代码有啥问题?

帅哥哟,离线,有人找我吗?
jianjingmaoyi
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
这段代码有啥问题?  发帖心情 Post By:2014/9/15 21:19:00 [只看该作者]

Dim tab As WinForm.TabControl
tab = forms("我的导航").CreateControl("Tab1", ControlTypeEnum.TabControl)
tab.Dock = Windows.Forms.DockStyle.Fill
tab.Font = New Font("微软雅黑", 10)
forms("我的导航").AddControl(tab)

Dim Arys As List(Of String())
Dim Products As List(Of String)
Products = DataTables("功能导航").GetValues("功能区")
For Each Product As String In Products
    Dim pg As WinForm.TabPage
    pg = tab.TabPages.Add(Product , Product & "  →")
    pg.BackColor = Color.WhiteSmoke
    Dim dr As DataRow= DataTables("功能导航").Find("功能区='" & Product & "'")
    If dr IsNot Nothing Then
        pg.Image = GetImage(dr("分类图标"))
    End If
    
    Dim Customers As List(Of String)
    Customers = DataTables("功能导航").GetValues("功能组","功能区='" & Product & "'","序号")
    For Each Customer As String In Customers
        
        Dim lvw As WinForm.ListView
        lvw = forms("我的导航").CreateControl(Customer, ControlTypeEnum.ListView)
        lvw.Dock = Windows.Forms.DockStyle.Fill
        lvw.Font = New Font("微软雅黑", 10)
        
        pg.AddControl(lvw)
        
        lvw.StopRedraw() '暂停绘制
        lvw.Groups.Clear
        lvw.Rows.Clear() '清除原来的行
        lvw.Images.Clear() '清除原来的图片
        lvw.View = ViewMode.LargeIcon
        lvw.Images.LargeSize = New Size(48, 48) '定义大图标尺寸
        
        Dim vg As WinForm.ListViewGroup = lvw.Groups.Add() '增加分组
        vg.Name = Customer
        vg.Text = "☆☆☆" & Customer & "☆☆☆"
        
        
        
        
        Arys = DataTables("功能导航").GetValues("模块名称|模块标题|模块图标","功能区='" & Product & "'And 功能组='" & Customer & "'","序号")
        For Each Ary As String() In Arys
            Dim key As String = Ary(2)
            lvw.Images.AddLargeImage(key, key) '添加照片,直接用文件名作为图片键值
            Dim vr As WinForm.ListViewRow = lvw.Rows.Add() '增加一行
            vr.Group = vg.Name
            vr.Name = Ary(0)
            vr.Text = Ary(1)
            vr.ImageKey = key
        Next
lvw.ResumeRedraw() '恢复绘制
    Next
Next

不能分组
[此贴子已经被作者于2014-9-15 21:19:28编辑过]

 回到顶部