R
Robert Bevington
Hi everyone,
I'm trying to create two listboxes that are filled with all the culture languages. This work's fine until I try to sort the listbox. If I set the listbox property Sort to true, the list is displayed alphabetically sorted. But when I select an item, the actual value points to a different language. I think the indexes are getting mixed up somehow.
So instead of sorting the listbox and thought I could sort the arraylist that I create in a separate class. However this throws an exception that two elements could not be compared.
For Each ParticularCulture As CultureInfo In CultureInfo.GetCultures(CultureTypes.SpecificCultures)
With ParticularCulture
prvSourceLangItems.Add(New LanguageItem(.DisplayName, .Name, .LCID))
prvTargetLangItems.Add(New LanguageItem(.DisplayName, .Name, .LCID))
End With
Next
prvSourceLangItems.Sort() 'Exception thrown here.
Anyone got any ideas how I can solve this problem?
Best regards,
Robert Bevington
I'm trying to create two listboxes that are filled with all the culture languages. This work's fine until I try to sort the listbox. If I set the listbox property Sort to true, the list is displayed alphabetically sorted. But when I select an item, the actual value points to a different language. I think the indexes are getting mixed up somehow.
So instead of sorting the listbox and thought I could sort the arraylist that I create in a separate class. However this throws an exception that two elements could not be compared.
For Each ParticularCulture As CultureInfo In CultureInfo.GetCultures(CultureTypes.SpecificCultures)
With ParticularCulture
prvSourceLangItems.Add(New LanguageItem(.DisplayName, .Name, .LCID))
prvTargetLangItems.Add(New LanguageItem(.DisplayName, .Name, .LCID))
End With
Next
prvSourceLangItems.Sort() 'Exception thrown here.
Anyone got any ideas how I can solve this problem?
Best regards,
Robert Bevington