Hi,
I'm trying to change the backcolor for specific control types, in the example below for all labels on the form.
I've tried to use 'System.Windows.Forms.Label' but get an error
'label' is a type in 'Forms' and cannot be used as an expression.
I cannot work out what the valid if statement should be:-
For Each ctrl As Control In Me.Controls
If ctrl.GetType = System.Windows.Forms.Label Then
Console.WriteLine("test " & ctrl.GetType.ToString)
ctrl.BackColor = Color.FromName("red")
End If
Next
Many thanks for any assistance provided
John T Barton
A single picture (or bit of code) is worth a thousand words