一个很不错的清空页面所有文本框内容的函数(也可随意改成页面其他控件类型)
 Private Sub SetTextBoxValue(ByVal Page As Control, ByVal TextBoxValue As String)
Private Sub SetTextBoxValue(ByVal Page As Control, ByVal TextBoxValue As String) For Each ctl As Control In Page.Controls
    For Each ctl As Control In Page.Controls If TypeOf ctl Is TextBox Then
            If TypeOf ctl Is TextBox Then CType(ctl, TextBox).Text = TextBoxValue
                CType(ctl, TextBox).Text = TextBoxValue Else
            Else If ctl.Controls.Count > 0 Then
                If ctl.Controls.Count > 0 Then SetTextBoxValue(ctl, TextBoxValue)
                    SetTextBoxValue(ctl, TextBoxValue) End If
                End If End If
            End If Next
        Next End Sub
End Sub调用例子:SetTextBoxValue(Me.Page,"想置换的string")
如果想置换页面所有的Label,只要把
If TypeOf ct1 Is TextBox Then中的TextBox 改成Label就行了,很不错的函数,供参考。
 
                     
                    
                 
                    
                 

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号