I have put 4 labels in one column and I want them to be sorted in a specific way:
*if one of them is temporaly invisible (labelX.visible=false) it makes all other, visible labels below, move one place forward to the top and keeps the same column order.


LABELS:
Label1
Label2
Label3
Label4


IF LABEL2.VISIBLE = FALSE: labels should be sorted like this
Label1
Label3
Label4

So I have written this code:

For Each tabPageCtrl In Me.TabControl1.Controls
For Each ctrl In tabPageCtrl.Controls
If TypeOf ctrl Is Label Then
If ctrl.Visible = True Then
ctrl.Top = visina
visina = visina + ctrl.Height
End If
End If
Next
Next

The problem is that VB compile label with the lowest identification number (in my case: label1) at the end and all other labels before.

So the VB compiling goes like this:

Label2
Label3
Label4
Label1 'at the end'

and that makes my sort program disfunctional.

Thank you for help