For Each c As WinForm.Control In e.Form.Controls If Typeof c Is WinForm.TextBox Then '判断控件是否是文本框 Dim t As WinForm.TextBox = c '使用特定类型的变量引用控件 t.Value = Nothing End IfNext
如上:typeof必须通过判断才能知道类型,怎么直接获取类型值?