以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] 老师好:在搜索的的时候,显示未找到类型“TabControl”的公共成员“Text” (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=189447) |
||||
-- 作者:xianxin2010 -- 发布时间:2023/12/2 19:50:00 -- [求助] 老师好:在搜索的的时候,显示未找到类型“TabControl”的公共成员“Text” 老师好: 原来的搜索窗口 功能都实现了,现在是在原有的窗口增加了个 页面集合 控件 在点击搜索的的时候,显示未找到类型“TabControl”的公共成员“Text”。 试过了只要在窗口加其他控件会出现 未找到公共成员“Text” 例子在下方了 谢谢 Dim flt As String For Each c As Col In Tables("表A").Cols For Each ctl As WinForm.Control In e.Form.Controls If ctl.name <> "Table1" AndAlso ctl.Name <> "Table2" Then If e.Form.Controls(ctl.Name).Text > "" Then If ctl.Gettype.Name = "RadioButton" Then If ctl.Name.Split("_")(0) = c.Name AndAlso e.Form.Controls(ctl.Name).Checked Then flt + = c.Name & " = \'" & e.Form.Controls(ctl.Name).Text & "\' And " End If Else If ctl.Name.Contains("0") AndAlso ctl.Name.Split("_")(0) = c.Name Then flt + = c.Name & " = \'" & e.Form.Controls(ctl.Name).Text & "\' And " ElseIf ctl.Name.Contains("1") AndAlso ctl.Name.Split("_")(0) = c.Name Then flt + = c.Name & " >= " & e.Form.Controls(ctl.Name).Text & " And " ElseIf ctl.Name.Contains("2") AndAlso ctl.Name.Split("_")(0) = c.Name Then flt + = c.Name & " <= " & e.Form.Controls(ctl.Name).Text & " And " ElseIf ctl.Name = c.Name AndAlso c.Name = "字符模糊搜索" Then flt + = c.Name & " Like \'%" & e.Form.Controls(ctl.Name).Text & "%\' And " End If End If End If End If Next Next If flt > "" Then flt = flt.SubString(0,flt.Length - 5) End If Tables("表A").Filter = flt
[此贴子已经被作者于2023/12/3 10:56:58编辑过]
|
||||
-- 作者:jshuipu66033 -- 发布时间:2023/12/3 13:55:00 -- |
||||
-- 作者:xianxin2010 -- 发布时间:2023/12/3 14:29:00 -- 谢谢,还是 等 有点蓝 老师吧! |
||||
-- 作者:有点蓝 -- 发布时间:2023/12/3 20:24:00 -- TabControl是没有text属性的,和表格一样排除掉 Dim flt As String For Each c As Col In Tables("表A").Cols For Each ctl As WinForm.Control In e.Form.Controls If ctl.name <> "Table1" AndAlso ctl.Name <> "Table2" AndAlso ctl.Name <> "TabControl1" Then If e.Form.Controls(ctl.Name).Text > "" Then |
||||
-- 作者:xianxin2010 -- 发布时间:2023/12/3 20:41:00 -- 明白了 |
||||
-- 作者:有点蓝 -- 发布时间:2023/12/3 20:44:00 -- 其实不应该判断控件名称,应该判断控件类型 Dim flt As String For Each c As Col In Tables("表A").Cols For Each ctl As WinForm.Control In e.Form.Controls If TypeOf ctl Is WinForm.Table OrElse TypeOf ctl Is WinForm.TabControl Then Else If e.Form.Controls(ctl.Name).Text > "" Then |