Home All Groups Group Topic Archive Search About

for each step order reverse direction ?

Author
11 Nov 2006 1:06 PM
Jason
How can I loop through in reverse order .. Not looking to sort or
anyting.

    Dim fr As FormViewRow =
(CType(whichformview.Controls(0).Controls(1), FormViewRow))
    Dim tc As TableCell = fr.Cells(0)
    For Each c As Control In tc.Controls

Author
11 Nov 2006 1:23 PM
Cor Ligthert [MVP]
"Jason"

> How can I loop through in reverse order .. Not looking to sort or
> anyting.
>
>    Dim fr As FormViewRow =
> (CType(whichformview.Controls(0).Controls(1), FormViewRow))
>    Dim tc As TableCell = fr.Cells(0)
      For i as integer = tc.Controls.count to 0 step -1

       etc.

I hope this helps,

Cor
Author
11 Nov 2006 6:08 PM
Kerry Moorman
Cor,

I'm sure you meant:

   For i as integer = tc.Controls.count - 1 to 0 step -1

Kerry Moorman

Show quoteHide quote
"Cor Ligthert [MVP]" wrote:

>
> "Jason"
>
> > How can I loop through in reverse order .. Not looking to sort or
> > anyting.
> >
> >    Dim fr As FormViewRow =
> > (CType(whichformview.Controls(0).Controls(1), FormViewRow))
> >    Dim tc As TableCell = fr.Cells(0)
>       For i as integer = tc.Controls.count to 0 step -1
>
>        etc.
>
> I hope this helps,
>
> Cor
>
>
>
Author
12 Nov 2006 6:43 AM
Cor Ligthert [MVP]
Kerry,

I am glad you corrected me, I was writing this and thought there is
something wrong, I was a little bit blind it seems.

Thanks,

Cor

Show quoteHide quote
"Kerry Moorman" <KerryMoor***@discussions.microsoft.com> schreef in bericht
news:97F66971-F945-4E05-8FA2-892247617EA4@microsoft.com...
> Cor,
>
> I'm sure you meant:
>
>   For i as integer = tc.Controls.count - 1 to 0 step -1
>
> Kerry Moorman
>
> "Cor Ligthert [MVP]" wrote:
>
>>
>> "Jason"
>>
>> > How can I loop through in reverse order .. Not looking to sort or
>> > anyting.
>> >
>> >    Dim fr As FormViewRow =
>> > (CType(whichformview.Controls(0).Controls(1), FormViewRow))
>> >    Dim tc As TableCell = fr.Cells(0)
>>       For i as integer = tc.Controls.count to 0 step -1
>>
>>        etc.
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>>
Author
12 Nov 2006 11:05 AM
Cor Ligthert [MVP]
Kerry,

To prevent that it happens again to me,

http://www.vb-tips.com/dbpages.aspx?ID=ae0f1099-86ce-4d3e-9122-ee18edae8295

Cor

Show quoteHide quote
"Kerry Moorman" <KerryMoor***@discussions.microsoft.com> schreef in bericht
news:97F66971-F945-4E05-8FA2-892247617EA4@microsoft.com...
> Cor,
>
> I'm sure you meant:
>
>   For i as integer = tc.Controls.count - 1 to 0 step -1
>
> Kerry Moorman
>
> "Cor Ligthert [MVP]" wrote:
>
>>
>> "Jason"
>>
>> > How can I loop through in reverse order .. Not looking to sort or
>> > anyting.
>> >
>> >    Dim fr As FormViewRow =
>> > (CType(whichformview.Controls(0).Controls(1), FormViewRow))
>> >    Dim tc As TableCell = fr.Cells(0)
>>       For i as integer = tc.Controls.count to 0 step -1
>>
>>        etc.
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>>