Assign array to a StandardValuesCollection
Hi all,
How can I make the items in a standard values collection identical to the items contained in a previously defined (dynamic) array of strings?
Here's a snippet;
Public Class ElementList : Inherits StringConverter
Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As ITypeDescriptorContext) As Boolean
Return True
End Function
Public Overloads Overrides Function GetStandardValues(ByVal context As ITypeDescriptorContext) As StandardValuesCollection
Return New StandardValuesCollection(New String() {elList})
End Function
Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As ITypeDescriptorContext) As Boolean
Return True
End Function
End Class
Here, elList is my shared array of strings, which has contents depending on the items in a listbox elsewhere on my form. So I want the items in the standard values collection to be equal to this listbox. The code doesn't work as it is, I assume I need to define some sort of delimiter in line 9?
The purpose of this is for a custom property grid which has a dropdown listbox as one of the properties. Thanks in advance!
Related Article: OMG! Control arrays in VB.NET????
is a VB.NET discussion thread by killbill07 that has 6 replies, was last updated 9 months ago and has been tagged with the keywords: array, code, control-array, development, help..., question, vb.net.
raheel88
Newbie Poster
12 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Self-Answered as of 1 Year Ago