以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  来回切换页面  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=114051)

--  作者:yangwenghd
--  发布时间:2018/1/27 11:29:00
--  来回切换页面
怎么设置来回切换两个页面啊,在一个按钮,感谢 感谢
If Forms("手机单词窗口").Controls("TabControl4").SelectedIndex = 1  \'点击后立刻显示TabControl的页面
    
ElseIf Forms("手机单词窗口").Controls("TabControl4").SelectedIndex = 0  \'点击后立刻显示TabControl的页面
    
End If

--  作者:有点蓝
--  发布时间:2018/1/27 11:31:00
--  


Dim tab As WinForm.TabControl = Forms("手机单词窗口").Controls("TabControl4")

If tab.SelectedIndex = 1  \'点击后立刻显示TabControl的页面
    tab.SelectedIndex = 0
ElseIf tab.SelectedIndex = 0  \'点击后立刻显示TabControl的页面
    tab.SelectedIndex = 1
End If

--  作者:yangwenghd
--  发布时间:2018/3/3 20:10:00
--  
问问可以是回到以前的页面吗?
比如 点一下跳到页面5,在点一下就回到跳到页面5之前的那个页面可以吗?感谢 感谢 

--  作者:有点甜
--  发布时间:2018/3/4 15:04:00
--  
Dim tab As WinForm.TabControl = Forms("手机单词窗口").Controls("TabControl4")
static pidx As Integer = tab.SelectedIndex
If tab.SelectedIndex <> 3 Then
    pidx = tab.SelectedIndex
    tab.SelectedIndex = 3
Else
    tab.SelectedIndex = pidx
End If

--  作者:yangwenghd
--  发布时间:2018/3/6 12:21:00
--  
感谢 感谢 ,可以再设计一个按钮吗?就是如果TabControl4页面已经在5页面了,就跳转到之前的一页,如果没有再TabControl4的5页面也就什么都不做,感谢 感谢 !!
--  作者:有点甜
--  发布时间:2018/3/6 12:23:00
--  

请上传具体实例说明你要做的东西,说明要做几个按钮,分别什么功能。


--  作者:yangwenghd
--  发布时间:2018/3/6 12:38:00
--  
感谢 其实就是把
Dim tab As WinForm.TabControl = Forms("手机单词窗口").Controls("TabControl4")
static pidx As Integer = tab.SelectedIndex
If tab.SelectedIndex <> 3 Then
    pidx = tab.SelectedIndex
    tab.SelectedIndex = 3
Else
    tab.SelectedIndex = pidx
End If

这个代码的返回功能 单独做个按钮,感谢 感谢 

--  作者:有点甜
--  发布时间:2018/3/6 15:18:00
--  

按钮1

 

Dim tab As WinForm.TabControl = Forms("手机单词窗口").Controls("TabControl4")
If tab.SelectedIndex <> 3 Then
    vars("pidx") = tab.SelectedIndex
    tab.SelectedIndex = 3
End If
 
按钮2
 
Dim tab As WinForm.TabControl = Forms("手机单词窗口").Controls("TabControl4")
If tab.SelectedIndex = 3 Then
    tab.SelectedIndex = vars("pidx")
End If