0
我试过这段代码,但它是抛出错误。如何从文本区域清除所有以前的文本?
Private Sub ClearText
Dim ctl As Control
' Clear all the TextBoxes on the form.
For Each ctl In Controls
If TypeOf ctl Is TextArea Then ctl.Text = ""
Next
End Sub
任何人都可以提出一些逻辑,感谢
**你得到了什么错误?** – SLaks
我认为Control类没有任何叫做Text的属性。你必须将'ctl'强制转换为'TextArea'才能访问它的'Text' – Roman