ALX
Well-known member
In the process of trying to get "Option Strict" turned on, I've cleaned up all of the Implicit Conversions in my code, and there were many! Now I'm trying to clear up "Late Bound Resolutions". In a couple of forms, I create almost all of the labels on the form at run time and store them in an ArrayList so that I can get a reference to each label as I need to. When refering to a label in that ArrayList, such as
I have a late bound resolution warning/error. Of course I have the same issue when the form is closing and I have to go through the ArrayList to dispose of all of these labels. This method of creating the labels at runtime is very flexible and convenient, and I hate to lose that by changing my method completely. How can I use this method without creating all of these late bound references to the labels in MyArrayList?
VB.NET:
Dim n As String = "whatever"
For j = 0 To MyArrayList.Count
If MyArrayList(j).name.ToString = n Then '<<< This reference is late bound...
'(...)
End If
Next
I have a late bound resolution warning/error. Of course I have the same issue when the form is closing and I have to go through the ArrayList to dispose of all of these labels. This method of creating the labels at runtime is very flexible and convenient, and I hate to lose that by changing my method completely. How can I use this method without creating all of these late bound references to the labels in MyArrayList?