我正在尝试通过此代码清空我的 VB6 表单上的所有控件
Public Sub ClearControls(frmName As Form, TagName As String)
Dim ctl As Control
For Each ctl In frmName.Controls
If ctl.Tag = TagName Then
If TypeOf ctl Is TextBox Then
ctl.Text = ""
ElseIf TypeOf ctl Is ListView Then
ctl.ListItems.Clear
ElseIf TypeOf ctl Is ComboBox Then
ctl.Clear
ElseIf TypeOf ctl Is OptionButton Then
ctl.Value = False
ElseIf TypeOf ctl Is DTPicker Then
ctl.Value = Date
ElseIf TypeOf ctl Is Label Then
ctl.Caption = ""
ElseIf TypeOf ctl Is CheckBox Then
ctl.Value = 0
End If
End If
Next
End Sub
检查 Combobox 和 Listview 时出现以下错误
“模块不是有效类型”
有什么建议么?