Results 1 to 14 of 14

Thread: [2005] A element of a User Control as a Property

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    49

    [2005] A element of a User Control as a Property

    Hello everybody!

    I am having some problems developing a user control.

    The control I'm developing is a control that has 4 buttons and a treeview.

    I want the developer who uses the control to be able to change de treeview properties. I have read in the internet, that I can set a "sub-control" of a user control as a property of the user control.

    So, in my control, I have two properties:

    Code:
    <Description("Toma o establece el color de fondo de los botones del control")> _
        Property ColorBotones() As Color
            Get
                Return B_Arriba.BackColor
            End Get
            Set(ByVal value As Color)
                B_Arriba.BackColor = value
                B_Abajo.BackColor = value
                B_Izquierda.BackColor = value
                B_Derecha.BackColor = value
            End Set
        End Property
    
        <Description("Toma o establece el control TreeView")> _
        Property Arbol() As TreeView
            Get
                Return TV_Arbol
            End Get
            Set(ByVal value As TreeView)
                TV_Arbol = value
            End Set
        End Property
    ColorBotones is used to change the backcolor of the four buttons (B_Arriba, B_Abajo, B_Izquierda, B_Derecha).
    Arbol() should be used to change the properties of the treeview of the user control.

    The ColorBotones proporty works perfectly, but Arbol() doesn't. In the designer view, I (the developer) can see the two properties correctly, but the changes I do in the Arbol property only changes the appearance in the designer view. When I execute the form that contains the usercontrol, all the changes I have done in the designer view disappear.

    Does anybody know where's the problem?

    Thanks in advance
    Last edited by sagoga69; Mar 5th, 2008 at 06:29 AM. Reason: Change the title

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