there are 10 labels and 1 button in the form and i want to set some properties using code(which will applicable to lable only) , and for this i used the code
For Each lbl As Label In Form1.Controls lbl.Font = New Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Point) lbl.Top = settop lbl.Left = 40 settop += 100 Next
Now the error is
Unable to cast object of type 'System.Windows.Forms.Button' to type 'System.Windows.Forms.Label'.
how to solve that issue