以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于多标签页窗口  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=30515)

--  作者:jpguo
--  发布时间:2013/3/29 14:09:00
--  关于多标签页窗口
目前在主界面的单据按钮中加入了以下代码,同时将各窗口加了“ Panel1 ”控件,单独的点击单据按钮能实现多标签窗口的效果,但是由于同一个表对应的列表和单据界面都是分开2个不同窗口(意向客户列表、意向客户),在界面的【意向客户】定义只能打开意向客户列表。
请问:怎么定义分别能打开列表、单据界面?
我想参考:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=30142&replyID=&skin=1
将项目的所有表集中一个地方处理,通过窗口【click】中来定义,但就是不知道怎么处理。

主界面上的【意向客户】单据按钮:
For ia As Integer = 0 To e.form.Controls("TabControl1").TabPages.Count -1
    If e.form.Controls("TabControl1").TabPages(ia).text = "意向客户列表" Then
        e.Form.Controls("TabControl1").SelectedIndex = ia
        Return
    End If
Next
 
Dim tbl As WinForm.TabControl =e.Form.Controls("TabControl1")
tbl.TabPages.Add("意向客户列表","意向客户列表")
forms("意向客户列表").open(-1000,-1000)
forms("意向客户列表").visible = False
If forms("意向客户列表").opened Then
    Dim ymy As WinForm.Panel = Forms("意向客户列表").Controls("Panel1")
    tbl.TabPages("意向客户列表").AddControl(ymy)
    ymy.Dock = Windows.Forms.DockStyle.fill
    tbl.SelectedIndex = tbl.TabPages.Count-1
End If

--  作者:jpguo
--  发布时间:2013/3/29 15:27:00
--  
参考这个项目:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=30142&replyID=&skin=1
我想做的是把所有的要打开的窗口全部在窗口的【click】中定义,应该如何改呀?
【click】
Select Case e.sender.name
       Case "订单"
Dim tabc As WinForm.TabControl
tabc= e.Form.Controls("TabControl1")
For a As Integer=0 To tabc.TabPages.Count-1
    If tabc.TabPages(a).Text="订单" Then
        tabc.SelectedIndex=a
        Return
    End If
Next
tabc.TabPages.Add("订单","订单")
tabc.SelectedIndex=tabc.TabPages.Count-1
tabc.SelectedPage.Image=GetImage("001.ico")
Forms("订单").open
Forms("订单").Visible=False
If Forms("订单").Opened  Then
    Dim panel As WinForm.Panel
    panel= Forms("订单").Controls("Panel1")
    tabc.TabPages("订单").AddControl(panel)
    panel.Dock= Windows.Forms.DockStyle.fill
    tabc.SelectedIndex=tabc.TabPages.Count-1
End If
         Case "采购"
Dim tabc As WinForm.TabControl
tabc= e.Form.Controls("TabControl1")
For a As Integer=0 To tabc.TabPages.Count-1
    If tabc.TabPages(a).Text="采购" Then
        tabc.SelectedIndex=a
        Return
    End If
Next
tabc.TabPages.Add("采购","采购")
tabc.SelectedIndex=tabc.TabPages.Count-1
tabc.SelectedPage.Image=GetImage("001.ico")
Forms("采购").open
Forms("采购").Visible=False
If Forms("采购").Opened  Then
    Dim panel As WinForm.Panel
    panel= Forms("采购").Controls("Panel1")
    tabc.TabPages("采购").AddControl(panel)
    panel.Dock= Windows.Forms.DockStyle.fill
    tabc.SelectedIndex=tabc.TabPages.Count-1
End If
End Select

【Doubleclick】
Dim tabc As WinForm.TabControl 
tabc=e.Form.Controls("TabControl1")
Dim str As String
str=tabc.SelectedPage.Text

If tabc.SelectedIndex<>0 Then 
    If Forms(str).Opened=True
       Forms(str).Close
    End If    
tabc.TabPages.Delete(str) 
End If