I am trying to run the code,in windows form using vb.net where I have multiple pictureboxes with properties like backgroudimage and location.
So I want to eliminate these repeated initilisations,and hence I am trying to initialise all the controls using GetType.Getproperties command. But I am getting an exception error
Private Sub Read_csv_file_itextbox_Load_1(sender As Object, e As EventArgs) Handles MyBase.Load
For Each c As Control In Me.Controls
If c.GetType().Name = "TextBox" Then
c.GetType().GetProperty("BackColor").SetValue(c, "Transparent", Nothing)
End If
Next
End Sub
And I also need to explicitly set properties for some textboxes That have naming TextBox1,TextBox2, Textbox3 so on.
And I want to access these Textbox in their even number indexing and perform my code.