Foxtable(狐表)用户栏目专家坐堂 → [求助]页面添加主表


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

主题:[求助]页面添加主表

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


加好友 发短信
等级:九尾狐 帖子:2927 积分:20161 威望:0 精华:0 注册:2012/2/3 17:45:00
[求助]页面添加主表  发帖心情 Post By:2018/7/16 20:39:00 [只看该作者]

老师,
   目录树,单击目录树按钮,就会在页面上添加页面,并在页面上添加表(主表),但是发现偶尔 页面上没有表显示出来,为什么呢?

NodeMouseClick


SystemReady = False


If e.Node.Level=0 Then

    e.Sender.CollapseAll

    If e.Node.IsExpanded=False Then

        e.Node.ExpandAll

    End If

End If

If e.Node.Nodes.Count=0 Then

    e.Form.StopRedraw

    Dim tab As WinForm.TabControl = e.Form.Controls("tbl_jd_serevmain_serevmain")

    e.Form.Controls("tbl_jd_serevmain_serevmain").Basecontrol.borderstyle = Windows.Forms.FormBorderStyle.None'去掉边框

    Dim pg As WinForm.TabPage

    '添加导航按钮

    Dim bttitle As String=e.Node.Name

    Dim btNames As New List(Of String)

    btNames.Clear

    Dim pnl As WinForm.Panel=Forms("serevmain").controls("pnl_serevmain_serevmain")

    For Each c As object In pnl.Children

        If Typeof c Is WinForm.Panel Then

            btNames.Add(c.name)

            c.backColor = Color.lightblue

        End If

    Next

    Dim btn As object

    If tab.TabPages.Contains("pg_serevmain_" & e.Node.Name) = False Then

        '添加页面

        tab.TabPages.Add("pg_serevmain_" & e.Node.Name,e.Node.Name)

        PG=tab.SelectedPage

        pg.Visible=False

        If pg IsNot Nothing Then

            If e.Form.ExistControl("tab_serevmain_" & e.Node.Name) Then

                e.Form.RemoveControl("tab_serevmain_" & e.Node.Name)

            Else

                Dim tbl As WinForm.Table

                tbl= e.Form.CreateTable("tab_serevmain_" & e.Node.Name,e.Node.Name,False)

                tbl.Table.AllowEdit=False

                e.Form.AddControl(tbl)

                tbl.Table.Filter=""

                ''重新生成表头

                Functions.Execute("za_nb_tablerename",tbl)

                Functions.Execute("za_nb_tableover",DataTables(e.Node.Name))

                ''重新生成表头

                'tbl.Enabled=False

                tbl.Visible=False

                tbl.Table.DataTable.SysStyles("Alternate").BackColor=Color.LightGray

                tbl.Table.DataTable.SysStyles("EmptyArea").BackColor = Color.White

                tbl.Table.DataTable.SysStyles("CurrentRow").BackColor = Color.FloralWhite

                tbl.Table.DataTable.MultiRowHeader = False

                tbl.Table.ListMode = True

                tab.tabpages("pg_serevmain_" & e.Node.name).AddControl(tbl)

                tbl.dock=5

                tbl.Visible=True

                '添加页面

                '添加导航按钮

                btn = Forms("serevmain").CreateControl("pnl_tit_serevmain_" & bttitle,ControlTypeEnum.Panel)

                btn.Visible = True

                btn.backColor = Color.GreenYellow

                btn.BaseControl.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None

                btn.BaseControl.dock=System.Windows.Forms.DockStyle.Left

                btn.BaseControl.anchor=System.Windows.Forms.AnchorStyles.Left

                btn.BaseControl.BackgroundImage = GetImage(Functions.Execute("za_nb_addtoplogo",btn,0,True))

                btn.Dock = 3

                btn.TopMost=True

                btn.width = 110'下面还有一个110数字要一样

                Dim la As WinForm.Label  = Forms("serevmain").CreateControl("lab_tit_serevmain_" & e.Node.Name,ControlTypeEnum.Label)

                la.text = e.Node.text

                la.Top = 12

                la.left =30

                la.topMost=False

                la.Enabled=False

                la.AutoSize = True

                btn.AddControl(la)

                pnl.AddControl(btn)

                btn.Height = btn.parent.height

                pg.Visible=True

                '添加导航按钮结束

            End If

        End If

    Else

        pg=tab.tabpages("pg_serevmain_" & e.Node.name)

        tab.SelectedPage=PG

        If pg IsNot Nothing Then

            btn = Forms("serevmain").Controls("pnl_tit_serevmain_" & bttitle)

            btn.backColor = Color.GreenYellow

            btn.Dock = 3

            btn.width = 110'上面还有一个110数字要一样

            pg.Visible=True

        End If

    End If

  

    If vars("p_serevmain_pidx").Contains(bttitle) = False Then'关闭再打开需要重新加载PAGE顺序使用

        vars("p_serevmain_pidx").add(bttitle)

        Functions.Execute("za_nb_zaformset",e,e.Node.name)

    End If

    

    E.Form.ResumeRedraw

End If

SystemReady = True


 回到顶部