Friday, December 27, 2013

For Each ....

No, the order isn't customizable with for each. You can iterate through the collection by index however you'd like. For example, you can use a For loop:



Dim buttons = g1.Children.OfType(Of Button)()
Dim startAt As Integer = 5
Dim numButtons = buttons.Count
For i As Integer = 0 To numButtons - 1
Debug.WriteLine(buttons((startAt + i) Mod numButtons).Content.ToString())
Next



--Rob


No comments:

Post a Comment