So guys, what im trying to do, is make my code shorter and delete like 20 settings in My.Settings. I changed 20 settings into a String Collection and that worked.
This is what I got.
But now, the picturebox have to have 2 settings Adress (Done by the code above) and a name to the adress, so I want to ask you, is there a way to save 2 things into 1 tag? Like WebBox.Tag = "Something, Something2". And how do you read it when you save it like that?
This is what I got.
Code:
For I As Integer = 1 To 5
Dim WebBoxControl() As Control
Dim WebBox As PictureBox
WebBoxControl = Me.Controls.Find("WebBox" & I.ToString, True)
If WebBoxControl.Length > 0 Then
WebBox = DirectCast(WebBoxControl(0), PictureBox)
My.Settings.WebPageAdresses(I) = WebBox.Tag
My.Settings.Save()
Else
Stop
Me.Close()
End If
Next