Hi guys, I'm trying to populate an indexed combobox, but I'm having trouble doing so, where am I going wrong?
[code] // Populate combobox
ComboBoxEuroAKg1.RemoveAllRows // rimuove tutte le righe
For i As Integer = 0 To risultatiOrdinati.Ubound
ComboBoxEuroAKg1.AddRow(risultatiOrdinati(i)) // aggiunge le righe una per una
Next
[/code]
Error: Calcolatore_Pesi_Costi.CercaMaterialiSimili, line 77
Static reference to instance method: call this on an instance of class DesktopPopupMenu.
ComboBoxEuroAKg1.RemoveAllRows // rimuove tutte le righe
Error:Calcolatore_Pesi_Costi.CercaMaterialiSimili, line 79
There is more than one method with this name but this does not match any of the available signatures.
ComboBoxEuroAKg1.AddRow(risultatiOrdinati(i)) // aggiunge le righe una per una
It should be something like this ?:
[code]
// Populate combobox
ComboBoxEuroAKg1().RemoveAllRows // removes all rows
For i As Integer = 0 To SortedResults.Ubound
ComboBoxEuroAKg1(ComboBoxEuroAKg1(i).AddRow(SortResults(i)) // adds the rows one by one
Next
[/code]
Usually, when I have this kind of trouble, I store risultatiOrdinati(i) in a variable as:
Var Atom As String // .AddRow needs a String
Atom = risultatiOrdinati(i)
ComboBoxEuroAKg1.AddRow Atom
Doing so allows me to know where the error stands: the array holds integers (or anything but Strings) or the ComboBox .AddRow is faultive; in the later case, I check with the documentation (I suppose the syntax is: AddRow(item As String)).
Ciao
What type is this variable? Array of ?
Dim risultatiOrdinati() As String
Thanks, I'll try tomorrow