Hi all, o7
Currently I'm using green line in every single event:
Code:
    Private Sub BtnAll_Click_1(sender As Object, e As EventArgs) Handles BtnAll.Click
        Dim SelectedUC As UC() = {Form1.UC1, Form1.UC2, Form1.UC3, Form1.UC4, Form1.UC5, Form1.UC6 Form1.UC7, Form1.UC8, Form1.UC9, Form1.UC10, Form1.UC11, Form1.UC12, Form1.UC13, Form1.UC14, Form1.UC15, Form1.UC16, Form1.UC17, Form1.UC18, Form1.UC19, Form1.UC20} 'THE ACTUAL COLLECTION IS UP TO 40
        For i = 0 To 20 'BETTER TO BE REPLACED WITH LENGTH - 1
            TANKS(i).INFOPAGE.Show()
        Next
    End Sub
I'm sure there is a simpler way to achieve declaring up to 40 UserControls at once (or get existing) like Dim allUCsAtOnce As New List(Of UC) From {} or other ways I'm not aware of. Also you can change their names, increase/decrease the number of them visually and there is no need to change anything else. ALSO variable/collection/array length can be use instead of constant numbers.