--- In [email protected], "kindawords"
<[EMAIL PROTECTED]> wrote:
> You need declare your function return type as an array, and use
> ListItem() in your CType call to indicate that you are converting to
> an array and not a single item.
Sorry can you clarify I am very new to this and all the casting is
confusing me. I have spent over a day trying to retrieve values from
a listbox :(
So I need to return an array ? Because at the the moment my return
type is of a single value in a list ? How would the last line of code
((Return xxx) look ?
Public Function GetSelectedItems() As Array()
Dim item As ListItem
Dim al = New ArrayList
For Each item In cboChannel.Items
If item.Selected = True Then
al.Add(item)
End If
Next item
Return CType(al.ToArray(GetType(ListItem)), ListItem())
End Function
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/