Foxtable(狐表)用户栏目专家坐堂 → [求助]Tabcontrol 引用窗口 控件问题


  共有2117人关注过本帖树形打印复制链接

主题:[求助]Tabcontrol 引用窗口 控件问题

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


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By:2016/11/21 16:21:00 [显示全部帖子]

函数的代码要改一下。

 

''---------------------------------------------------------------------------------------------------------------------------
'''功能:模块导航窗口按钮事件                          leexianfeng           日期:2016-11-14 10:14:57

Dim nm As String =Args(0)
Dim tt As String =Args(1)
Dim frmName As String
'MessageBox.show(nm & vbcrlf & tt)
Dim tabc As WinForm.TabControl = Forms("0010 首页").Controls("TabControl2")
Dim dr As DataRow =DataTables("Z99设置").Find("窗口_标题 = '"& tt &"'")
'MessageBox.show(dr("窗口_名称"))
If dr IsNot Nothing Then
    frmName =dr("窗口_名称")
    For a As Integer=0 To tabc.TabPages.Count-1  '如果当前页签中存在所选的页签,则跳出
        If tabc.TabPages(a).Text=tt Then
            tabc.SelectedIndex=a
            Return Nothing
        End If
    Next
   
    Forms(frmName).open(-1000,-1500)   '打开窗口的位置偏移后,避免出现窗口闪退
   
    If Forms(frmName).Opened Then
        Dim pb = tabc.BaseControl
        tabc.TabPages.Add(nm,tt)
        Forms(frmName).BaseForm.TopLevel = False
        Forms(frmName).BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        Forms(frmName).BaseForm.Dock = System.Windows.Forms.DockStyle.Fill
       
        'PB.TabPages(nm).Controls.Clear
        PB.TabPages(nm).Controls.add(Forms(frmName).BaseForm)
        tabc.SelectedPage = tabc.TabPages(nm)
        tabc.SelectedPage.Image=GetImage("001.ico")
        'tabc.Form.Select
        'tabc.Select
    End If
End If
''---------------------------------------------------------------------------------------------------------------------------


 回到顶部