以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 安条件删除页面集合 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174233) |
-- 作者:采菊东篱下 -- 发布时间:2022/1/6 14:39:00 -- 安条件删除页面集合 注识的代码直接删除页面没问题的,但加上条件后页面集合全不见了。要求未保存数据的临时页面不允许删除。 \'If Forms("主窗口").opened Then \'If Forms("主窗口").Controls("TabControl1").SelectedIndex > 2 Then \'Dim tab As WinForm.TabControl = Forms("主窗口").Controls("TabControl1") \'tab.TabPages.Delete(tab.SelectedIndex) \'End If \'End If If Forms("主窗口").opened Then Dim pg As WinForm.TabPage If Forms("主窗口").Controls("TabControl1").SelectedIndex > 2 Then Dim qsmc As WinForm.ComboBox = Forms("主窗口").Controls("棋赛名称") Dim di1 As String = qsmc.Value If di1 = "" Then messagebox.show("请选择棋赛名称") Return End If Dim m As WinForm.TextBox = Forms("主窗口").Controls("第几轮") Dim di2 As String = m.Value If di2 = "" Then messagebox.show("请输入第几轮") Return End If Dim bsrq As WinForm.DateTimePicker = Forms("主窗口").Controls("rq") Dim di3 As Date = bsrq.Value If Forms("主窗口").Controls("rq").text = "" Then messagebox.show("请选择日期") Return End If Dim bslx As WinForm.TextBox = Forms("主窗口").Controls("bslx") Dim lx As String = bslx.Value Dim fz As WinForm.DropDownBox = Forms("主窗口").Controls("fenzhu") Dim Str As String = fz.Value If Forms("主窗口").Controls("fenzhu").text = "" Then messagebox.show("请选择分组") Return End If If Forms("主窗口").Controls("TabControl1").SelectedPage.Name = Str Then Dim drs As List(of DataRow) = DataTables("比赛积分").SQLSelect("[团体赛或个人赛] = \'" & lx & "\' And [棋赛名称] = \'" & di1 & "\' And [第几轮比赛] = \'" & di2 & "\' And [分组] = \'" & Str & "\'") For Each dr As DataRow In drs If dr.IsNull("积分") Then Return Else Dim tab As WinForm.TabControl = Forms("主窗口").Controls("TabControl1") tab.TabPages.Delete(tab.SelectedIndex) End If Next Else Dim tab As WinForm.TabControl = Forms("主窗口").Controls("TabControl1") tab.TabPages.Delete(tab.SelectedIndex) End If End If End If
[此贴子已经被作者于2022/1/6 17:22:19编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/1/6 14:44:00 -- If Forms("主窗口").Controls("TabControl1").SelectedPage.Name = Str Then if DataTables("比赛积分").SQLfind("[团体赛或个人赛] = \'" & lx & "\' And [棋赛名称] = \'" & di1 & "\' And [第几轮比赛] = \'" & di2 & "\' And [分组] = \'" & Str & "\' and 积分 is null") is nothing then Dim tab As WinForm.TabControl = Forms("主窗口").Controls("TabControl1") tab.TabPages.Delete(tab.SelectedIndex) End If Else
|
-- 作者:采菊东篱下 -- 发布时间:2022/1/6 17:30:00 -- 你这样写还有两种页面名字结尾多了些字符的不能删除。 [此贴子已经被作者于2022/1/6 20:50:06编辑过]
|
-- 作者:采菊东篱下 -- 发布时间:2022/1/6 17:31:00 -- 一个是排座查询表,一个是成绩查询表。 |
-- 作者:采菊东篱下 -- 发布时间:2022/1/6 18:08:00 -- If Forms("主窗口").opened Then Dim qsmc As WinForm.ComboBox = Forms("主窗口").Controls("棋赛名称") Dim di1 As String = qsmc.Value If di1 = "" Then messagebox.show("请选择棋赛名称") Return End If Dim m As WinForm.TextBox = Forms("主窗口").Controls("第几轮") Dim di2 As String = m.Value If di2 = "" Then messagebox.show("请输入第几轮") Return End If Dim bsrq As WinForm.DateTimePicker = Forms("主窗口").Controls("rq") Dim di3 As Date = bsrq.Value If Forms("主窗口").Controls("rq").text = "" Then messagebox.show("请选择日期") Return End If Dim bslx As WinForm.TextBox = Forms("主窗口").Controls("bslx") Dim lx As String = bslx.Value Dim fz As WinForm.DropDownBox = Forms("主窗口").Controls("fenzhu") Dim Str As String = fz.Value If Forms("主窗口").Controls("fenzhu").text = "" Then messagebox.show("请选择分组") Return End If If Forms("主窗口").Controls("TabControl1").SelectedIndex > 2 Then Dim tab As WinForm.TabControl = Forms("主窗口").Controls("TabControl1") If Forms("主窗口").Controls("TabControl1").SelectedPage.Name = Str Then If DataTables("比赛积分").SQLfind("[团体赛或个人赛] = \'" & lx & "\' And [棋赛名称] = \'" & di1 & "\' And [第几轮比赛] = \'" & di2 & "\' And [分组] = \'" & Str & "\' and 积分 is null") Is Nothing Then tab.TabPages.Delete(tab.SelectedIndex) End If Else tab.TabPages.Delete(tab.SelectedIndex) End If End If End If
|