Click here to Skip to main content
15,913,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to upload webpages to the site Pin
Sgn_Flex13-Feb-06 0:44
Sgn_Flex13-Feb-06 0:44 
GeneralRe: How to upload webpages to the site Pin
Dave Kreskowiak13-Feb-06 5:52
mveDave Kreskowiak13-Feb-06 5:52 
QuestionBIOS changes Pin
rzvme12-Feb-06 22:07
rzvme12-Feb-06 22:07 
AnswerRe: BIOS changes Pin
Dave Kreskowiak13-Feb-06 5:50
mveDave Kreskowiak13-Feb-06 5:50 
QuestionHow to Create typeconverter dynamically by reflection to use in a PropertyGrid? Pin
Mohamed Ali Jinnah12-Feb-06 21:29
Mohamed Ali Jinnah12-Feb-06 21:29 
AnswerRe: How to Create typeconverter dynamically by reflection to use in a PropertyGrid? Pin
J4amieC12-Feb-06 23:28
J4amieC12-Feb-06 23:28 
GeneralRe: How to Create typeconverter dynamically by reflection to use in a PropertyGrid? Pin
Mohamed Ali Jinnah13-Feb-06 0:05
Mohamed Ali Jinnah13-Feb-06 0:05 
GeneralRe: How to Create typeconverter dynamically by reflection to use in a PropertyGrid? Pin
Danilo Corallo10-Apr-06 3:09
Danilo Corallo10-Apr-06 3:09 
Hi, the answer to your need,
is use an Attribute to pass the dynamic list to your TypeConverter. Please check my recent article here:

http://www.codeproject.com/useritems/PropertyGridEx.asp

Here is my TypeConverter Wink | ;) :

VB
Public Class CustomChoices
    Inherits ArrayList

    Public Sub New(ByVal array As ArrayList, Optional ByVal IsSorted As Boolean = False)
        Me.AddRange(array)
        If IsSorted Then Me.Sort()
    End Sub

    Public Sub New(ByVal array() As String, Optional ByVal IsSorted As Boolean = False)
        Me.AddRange(array)
        If IsSorted Then Me.Sort()
    End Sub

    Public Sub New(ByVal array() As Integer, Optional ByVal IsSorted As Boolean = False)
        Me.AddRange(array)
        If IsSorted Then Me.Sort()
    End Sub

    Public Sub New(ByVal array() As Double, Optional ByVal IsSorted As Boolean = False)
        Me.AddRange(array)
        If IsSorted Then Me.Sort()
    End Sub

    Public Sub New(ByVal array() As Object, Optional ByVal IsSorted As Boolean = False)
        Me.AddRange(array)
        If IsSorted Then Me.Sort()
    End Sub

    Public ReadOnly Property Items() As ArrayList
        Get
            Return Me
        End Get
    End Property

    Public Class CustomChoicesTypeConverter
        Inherits TypeConverter
        Private oChoices As CustomChoicesAttributeList = Nothing
        Public Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
            Dim Choices As CustomChoicesAttributeList = context.PropertyDescriptor.Attributes(GetType(CustomChoicesAttributeList))

            If Not Choices Is Nothing Then
                oChoices = Choices
                GetStandardValuesSupported = True
            Else
                GetStandardValuesSupported = False
            End If
        End Function
        Public Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
            Dim Choices As CustomChoicesAttributeList = context.PropertyDescriptor.Attributes(GetType(CustomChoicesAttributeList))

            If Not Choices Is Nothing Then
                oChoices = Choices
                GetStandardValuesExclusive = True
            Else
                GetStandardValuesExclusive = False
            End If
        End Function
        Public Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
            Dim Choices As CustomChoicesAttributeList = context.PropertyDescriptor.Attributes(GetType(CustomChoicesAttributeList))
            If Not oChoices Is Nothing Then
                Return oChoices.Values
            End If
            Return MyBase.GetStandardValues(context)
        End Function
    End Class

    Public Class CustomChoicesAttributeList
        Inherits Attribute
        Private oList As New ArrayList

        Public ReadOnly Property Item() As ArrayList
            Get
                Return Me.oList
            End Get
        End Property

        Public ReadOnly Property Values() As TypeConverter.StandardValuesCollection
            Get
                Return New TypeConverter.StandardValuesCollection(Me.oList)
            End Get
        End Property

        Public Sub New(ByVal List() As String)
            MyBase.New()
            oList.AddRange(List)
        End Sub

        Public Sub New(ByVal List As ArrayList)
            MyBase.New()
            oList.AddRange(List)
        End Sub

        Public Sub New(ByVal List As ListBox.ObjectCollection)
            MyBase.New()
            oList.AddRange(List)
        End Sub
    End Class


-- modified at 9:11 Monday 10th April, 2006
QuestionRegarding datagrid control (very urgent) Pin
nagalakshmibasireddy12-Feb-06 21:21
nagalakshmibasireddy12-Feb-06 21:21 
Questionremote connection error! Pin
pandapatin12-Feb-06 20:19
pandapatin12-Feb-06 20:19 
AnswerRe: remote connection error! Pin
Dave Kreskowiak14-Feb-06 8:03
mveDave Kreskowiak14-Feb-06 8:03 
Questionencountring a substring from a string inputted in a textbox Pin
anurag11oct12-Feb-06 18:49
anurag11oct12-Feb-06 18:49 
AnswerRe: encountring a substring from a string inputted in a textbox Pin
Colin Angus Mackay12-Feb-06 20:28
Colin Angus Mackay12-Feb-06 20:28 
QuestionHow to make a Web Browser based on these criterias? Pin
Iftikhar Ali12-Feb-06 17:38
Iftikhar Ali12-Feb-06 17:38 
AnswerRe: How to make a Web Browser based on these criterias? Pin
Dave Kreskowiak13-Feb-06 5:56
mveDave Kreskowiak13-Feb-06 5:56 
AnswerRe: How to make a Web Browser based on these criterias? Pin
Iftikhar Ali13-Feb-06 19:55
Iftikhar Ali13-Feb-06 19:55 
QuestionProblem migrating from VB to VB.NET Pin
drexler_kk12-Feb-06 17:38
drexler_kk12-Feb-06 17:38 
AnswerRe: Problem migrating from VB to VB.NET Pin
Dave Kreskowiak13-Feb-06 5:46
mveDave Kreskowiak13-Feb-06 5:46 
GeneralRe: Problem migrating from VB to VB.NET Pin
drexler_kk13-Feb-06 16:33
drexler_kk13-Feb-06 16:33 
QuestionNeed to print a single record from the data report Pin
Santhosh Nickson12-Feb-06 16:25
Santhosh Nickson12-Feb-06 16:25 
Questionprogramming for communications in VB6 using USB port Pin
wtfskh12-Feb-06 16:16
wtfskh12-Feb-06 16:16 
AnswerRe: programming for communications in VB6 using USB port Pin
Dave Kreskowiak13-Feb-06 5:38
mveDave Kreskowiak13-Feb-06 5:38 
Questionhow to enter txt in datagrid in another form Pin
thepityone12-Feb-06 16:10
thepityone12-Feb-06 16:10 
QuestionCANCEL ON GOING PROCESS Pin
aqui_i12-Feb-06 15:58
aqui_i12-Feb-06 15:58 
AnswerRe: CANCEL ON GOING PROCESS Pin
alien viper12-Feb-06 16:31
alien viper12-Feb-06 16:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.