raheel88 0 Newbie Poster

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.