RichTextBox

I have several Richtextboxes on my form and require a way to step up a loop that will clear all the Richtextboxes with the press of a button. Instead of typing RichTextBox.Text="" many times.  Please sent code, if possible.
HeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Use the form's control collection.

Private Sub Command1_Click()
Dim objCtl As Control

    For Each objCtl In Me.Controls
        If TypeName(objCtl) = "RichTextBox" Then
            objCtl.Text = ""
        End If
    Next
End Sub
0
 
HeAuthor Commented:
Thanks so much for the help!  It was great.
0
All Courses

From novice to tech pro — start learning today.