确定哪些页面文本框在多页上包含文本已解决

问题描述



是否可以确定文本框在哪些页面上具有任何值?
并获取非空文本框选项卡的名称。

设置:
在Page1 TextBox1上,在Page2 TextBox2上。
如果TextBox2具有值初始化,则需要获取页面的名称。
预先感谢!

Multipage

到目前为止,我一直在尝试从特定文本框中获取值。

a = ""
Dim r As Integer
For r = 5 To 12
    If step_0.Controls("TextBox" & r).Value <> "" Then
    a = a & " " & step_0.MultiPage1.Pages(r - 5).Caption
    End If
Next

最后,我设法解决了这个问题。

解决方法

所以经过一番思考,我找到了这个解决方案。
如果您想将多页标题与文本框结合使用,这会很方便。
代码:

a = ""
Dim r As Integer
For r = 5 To 12
'according to count of textboxes should be 1 to whatever
    If UserForm1.Controls("TextBox" & r).Value <> "" Then
    a = a & " " & UserForm1.MultiPage1.Pages(r - 5).Caption
'since the first page index is 0,subtract the integer. It only works if they arranged like this:
'page0-tbox1,page1-tbox2 page_n-tbox_n+1....
'a= creates a list with the captions of pages which has fulfilled textboxes.
    End If
Next

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...