I have a popup control that I fill with a list of vendor names, and use the RowTag to store the vendor’s database Id.
When this window opens in “edit” mode, I need it to default-select the vendor that matches the record.
I do it like this:
For index As Integer = 0 To PopupVendor.ListCount
If PopupVendor.RowTag ( index ) = vendorShipment.Vendor.VendorId Then
PopupVendor.ListIndex = index
Exit
End If
Next
.Net has nice “find” features, and while I’m not really comparing one language to another, I just want to know if what I’ve done here is the ‘right’ way to do it.
I’m still very green with Xojo…
Are you sure? I had expected ListCount to be zero based too, but when I write it out to the debug window, it says “2”. That would be 3 items for a zero based list wouldn’t it?