Results 1 to 12 of 12

Thread: [RESOLVED] Displaying Property Arrays in PropertyGrid control

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Posts
    384

    Resolved [RESOLVED] Displaying Property Arrays in PropertyGrid control

    Hello.

    It seems as if the propertygrid control cannot display property arrays. Is this the case?

    When I do this :

    Code:
    Imports System.ComponentModel
    
    Public Class comPicturePirate
    
        Private intAmountImages As Integer
    
        Private strWebURL As String
        Private strPageName As String
        Private strPageTitle As String
    
        Public lstOutPutImages As New List(Of Image)
    
        Public Sub New(ByVal pic As List(Of Image))
            For index = 0 To pic.Count '- 1
                ' Me.PB = pbn
                lstOutPutImages.Item(index) = pic.Item(index)
            Next
        End Sub
    
        <Description("Contained Images"), _
        Category("Settings"), Browsable(True), Bindable(True)> _
        Public Property Images(ByVal index As Integer) As Image
            Get
                Return lstOutPutImages.Item(index)
            End Get
            Set(ByVal value As Image)
                lstOutPutImages.Add(value)
            End Set
        End Property
    
        <Description("Website URL Where Image(s) Should Appear"), _
        Category("Settings"), Browsable(True), Bindable(True)> _
        Public Property WebURL(ByVal index As Integer) As String
            Get
                Return strWebURL(index)
            End Get
            Set(ByVal value As String)
                strWebURL = value
            End Set
        End Property
    
        <Description("Page Name Where Image(s) Should Appear"), _
        Category("Settings"), Browsable(True), Bindable(True)> _
        Public Property PageName(ByVal index As Integer) As String
            Get
                Return strPageName(index)
            End Get
            Set(ByVal value As String)
                strPageName = value
            End Set
        End Property
    
        <Description("Page Name Where Image(s) Should Appear"), _
        Category("Settings"), Browsable(True), Bindable(True)> _
        Public Property PageTitle(ByVal index As Integer) As String
            Get
                Return strPageTitle(index)
            End Get
            Set(ByVal value As String)
                strPageTitle = value
            End Set
        End Property
    
        <Description("Number Of Images Contained"), _
        Category("Settings"), Browsable(True), Bindable(True)> _
        Public Property AmountImages() As Integer
            Get
                Return intAmountImages
            End Get
            Set(ByVal value As Integer)
                intAmountImages = value
            End Set
        End Property
    End Class
    And in the calling form I do this :

    Code:
        Private Sub btnPPCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPPCreate.Click
            Dim frmProps As New frmPPProperties
            Private arrOutPutImages As comPicturePirate
    
            arrOutPutImages = New comPicturePirate
    
            frmProps.prgPPProp.CommandsVisibleIfAvailable = True
            frmProps.prgPPProp.Text = "Images"
            frmProps.prgPPProp.SelectedObject = arrOutPutImages
    
    
            frmProps.Show()
        End Sub
    It only shows the property named AmountImages - which is not a property array.

    I need to show the other propertyies as well, and I do not know how

    Can anyone help please?
    Last edited by GrimmReaper; Feb 22nd, 2011 at 05:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width