On Fri, 31 Jan 2014, PICCORO McKAY Lenz wrote:
> >> do the following: create a String[] aResult or something. Then use the
> >> hresult["whatever_id"], converted to an Integer, as index:
> >>
> >>   aResult.Add(hresult["payload"], CInt(hresult["whatever_id"]))
> >>
> > umm this mees might work like the collection idea also
> dont work!!! combobox auto enumrate the index, so i'll try now with collection
> 
> >> Later, return that String[] as you do.
> >>
> >> Then, when filling the ComboBox, all the elements you didn't assign 
> >> anything
> >> to (the missing "whatever_id"'s will be Null):
> >>
> >>   Dim aResult As String[] = GetTheResultArray()
> >>   Dim iInd As Integer
> >>
> >>   For iInd = 0 To aResult.Max
> >>     If Not aResult[iInd] Then Continue
> >>     myComboBox.Add(aResult[iInd], iInd)
> >>   Next
> >>
> >> Whether this works (your question below) or how it will look like if some
> >> indices in the ComboBox are missing, I don't know. Test it!
> how can i fill the combobox but u must note the resultset object are
> not in same class
> i use a class for data and other for fill combox
> 
> SO THE QUESTION ITS:
> how can i use colletions to fill the combobox?
> 

You have the "whatever_id" field as an index - which is an Integer - and
still want to use Collection? OK, then:

  Dim cResult As Collection = GetTheResultCollection()
  Dim sRes As String

  For Each sRes In cResult
    myComboBox.Add(sRes, CInt(cResult.Key))
  Next

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to