Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27127

How to sort items in the Me.Controls collection

$
0
0
I have the code below which works great. However, what I really want is to sort the Controls collection in the order that I have set the TabIndex of the controls.

Haven't quite figured it out....

Code:

    Function IsDataFilledIN() As Boolean
        IsDataFilledIN = True
        For Each subcontrol As Control In Me.Controls
            If subcontrol.Tag = 1 Then
                If subcontrol.Text = "[Select value]" Then
                    MsgBox("Value must be filled in. " & subcontrol.Name)
                    subcontrol.Focus()
                    subcontrol.BackColor = Color.Red
                    Return False
                    Exit Function
                End If
            End If
        Next subcontrol

    End Function


Viewing all articles
Browse latest Browse all 27127

Latest Images

Trending Articles



Latest Images