Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Loop through all textboxes

$
0
0

Hi..in my project i have multiple textboxes with names starting as tb_something. All textboxes are located in groupbox, but code bellow wont find the textboxes that i wanna check. Can anyone pls help me with this issue.

  For Each GB As Control In Me.Controls
            If TypeOf GB Is GroupBox Then
                For Each ctl As Control In GB.Controls
                    If TypeOf ctl Is TextBox Then
                        If ctl.Name.StartsWith("tb") Then
                            MsgBox("Test")
                        End If

                    End If

                Next
            End If
        Next


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>