如何在webChart自定义控件中(从WebControl中继承),移出不需要的属性

解决方案 »

  1.   

    如何在webChart自定义控件中(从WebControl中继承),移出不需要的属性
      

  2.   

    Browsable(False)
    <NotifyParentProperty(True),Browsable(False)> _
            Public Overrides Property CssClass() As String
            Get
                Return MyBase.CssClass
            End Get
            Set(ByVal Value As String)
                MyBase.CssClass = Value
       end set
        End Property
      

  3.   

    谢谢 rickjelly2004(rick & jelly),搞定了,现在我碰到了这样一个问题“我想在设计的时候看到属性改变后的效果,比如vs自带的控件label在改变Text属性后,在设计中可以直接看到,但现在要等到执行后到页面上才能看到,”
      

  4.   

    看不到的原因,一:可能是你在DESIGNER中写了二:<NotifyParentProperty(True)
    EnsureChildControls()
      

  5.   

    还是不太明白,以上两点,我都没有,“比如现在我设置控件的width为300,可设计器上没有变化,怎么办?”
      

  6.   

    你的控件是继承什么做的,WEBCONTROL?????
      

  7.   


    我晓的了 <NotifyParentProperty(True)> _
            Public Overrides Property BackColor() As System.Drawing.Color
            Get
                Return MyBase.BackColor
            End Get
            Set(ByVal Value As System.Drawing.Color)
                MyBase.BackColor = Value
                If Not 子控件 Is Nothing Then
                    子控件.BackColor = MyBase.BackColor
                End If
            End Set
        End Property<NotifyParentProperty(True)> _
           Public Overrides Property Width() As System.Web.UI.WebControls.Unit
            Get
    Return MyBase.Width        End Get
            Set(ByVal Value As System.Web.UI.WebControls.Unit)
    MyBase.Width=value
     If Not 子控件 Is Nothing Then
                    子控件.Width= MyBase.Width
                End If        End Set
        End Property
      

  8.   

    是不是这样?我对vb.net不是很精通,好像这样不行
    [NotifyParentProperty(true)]
    public override Unit Width
    {
    get
    {
    return base.Width;
    }
    set
    {
    base.Width = value;
    if (Controls != null)
    {
    this.Width = base.Width;
    }
    }
    }
      

  9.   

    “子控件”就是在整个控件中加的控件啊,譬如BUTTON等等
      

  10.   

    请在这个帖子中讨论,谢谢
    http://community.csdn.net/Expert/topic/3924/3924466.xml?temp=.9307672
      

  11.   

    请在这个帖子中讨论,谢谢
    http://community.csdn.net/Expert/topic/3924/3924466.xml?temp=.9307672