怎样便历多个不同名字的TEXTBOX的同个属性 Dim Control As Control For Each Control In Me.Controls If TypeOf Control Is TextBox Then MsgBox Control.Name End If Next 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把MsgBox Control.Name改成Control.text=""就可以清空所有文本框中的文字 Private Sub Command1_Click()Dim txt As ControlFor Each txt In Me.Controls If TypeName(txt) = "TextBox" Then txt.Text = "" End IfNextEnd Sub Dim ctrl As ControlFor Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Then ctrl = ""Next Dim Control As Control For Each Control In Me.Controls If TypeOf Control Is TextBox Then MsgBox Control.Name End If Next 如何自定义类似枚举型的变量? 用ADO读取excel2007里的数据 VB 求时间相加 怎么相加...谢谢. [求助] VB 比较判断位置读取的问题 请问VB数据库变成中"&","+"以及"'"的含义 在使用ADODC连接过程中出现"至少一个参数没有被指定值",请指点 请问哪里有关于皮肤的插件下载? 请问怎样把form中的picture属性中的图片删除? 高分求教!! 一个 select 语句,急(怎么删除一个表中的某一个字段) VB还有前途吗 制作VB自訂控件遇到的問題(一天了也沒找到個解決方法)----求助中!!!
Control.text=""就可以清空所有文本框中的文字
Dim txt As Control
For Each txt In Me.Controls
If TypeName(txt) = "TextBox" Then
txt.Text = ""
End If
Next
End Sub
For Each ctrl In Me.Controls
If TypeName(ctrl) = "TextBox" Then ctrl = ""
Next
For Each Control In Me.Controls
If TypeOf Control Is TextBox Then
MsgBox Control.Name
End If
Next