Reference to a non-shared member requires an object reference

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cday119
    New Member
    • Mar 2008
    • 29

    Reference to a non-shared member requires an object reference

    Reference to a non-shared member requires an object reference in the declarations on "Form1.tabSearc h.". Anyone know why this is happening?

    Code:
        Public Function getArgs(ByVal Op As String, ByVal OpeningQuote As String, ByVal ClosingQuote As String, Optional ByVal controls As Windows.Forms.Control.ControlCollection = Form1.tabSearch.Controls) As String
    
            Dim args As String = " "
            Dim Text As New Control
            For Each Text In controls
                If TypeOf Text Is TextBox Then
                    If Text.Text <> "" Then
                        args = Text.Name & " " & Op & " " & OpeningQuote & Text.Text & ClosingQuote
                    End If
                End If
            Next
            Return args
        End Function
Working...