Properties of Properties

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    #1

    Properties of Properties

    I have a System.Web.UI.C ontrol which has a property of type
    System.Drawing. Font. When editing this control in an *.aspx file, how do I
    assign a value to this property? If I recall correctly, the attributes in
    the server tag are a combination of the property name and the property of
    that property separated by a "-" or something. However, I would also like to
    be able to use the Property Grid to do this. I tried using the Browsable
    attribute for the property, but that did not seem to help. Here is my
    current code for the property:

    <System.Compone ntModel.Browsab le(True)WriteOn ly Property Font() As
    System.Drawing. Font
    Set(ByVal value As System.Drawing. Font)
    Me._font = value
    End Set
    End Property

    Am I forgetting something? Any help would be appreciated. Thanks.
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Properties of Properties

    in general the property designer only support simple types by default
    (string, numbers, enum). while the designer knows about color and size,
    window fonts are not included. you will need to write your own prop designer
    to support them. in the asp.net syntax, all properties must be able to be
    specified as a string.

    as fonts are specified to the browser via a style command, not sure why you
    do not just support a style and class (CSSClass) properties.


    -- bruce (sqlwork.com)


    "Nathan Sokalski" wrote:
    I have a System.Web.UI.C ontrol which has a property of type
    System.Drawing. Font. When editing this control in an *.aspx file, how do I
    assign a value to this property? If I recall correctly, the attributes in
    the server tag are a combination of the property name and the property of
    that property separated by a "-" or something. However, I would also like to
    be able to use the Property Grid to do this. I tried using the Browsable
    attribute for the property, but that did not seem to help. Here is my
    current code for the property:
    >
    <System.Compone ntModel.Browsab le(True)WriteOn ly Property Font() As
    System.Drawing. Font
    Set(ByVal value As System.Drawing. Font)
    Me._font = value
    End Set
    End Property
    >
    Am I forgetting something? Any help would be appreciated. Thanks.
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

    >
    >
    >

    Comment

    • Nathan Sokalski

      #3
      Re: Properties of Properties

      My reason for not using a style and class is because the control will be
      generating an image, and therefore needs a System.Drawing. Font object.
      Assuming you are correct in your statements, I will probably need to just
      make separate properties and use the System.Drawing. Font constructor to
      create the font. I was just hoping to not need to make separate properties,
      but I guess that's all I can do for now since I don't know how to make
      Property Designers yet (and there probably wouldn't be much point in this
      case, since I only have one control that would need it). Thanks.
      --
      Nathan Sokalski
      njsokalski@hotm ail.com
      有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


      "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
      news:28C57787-19E0-4F75-A857-62D5EF417BD8@mi crosoft.com...
      in general the property designer only support simple types by default
      (string, numbers, enum). while the designer knows about color and size,
      window fonts are not included. you will need to write your own prop
      designer
      to support them. in the asp.net syntax, all properties must be able to
      be
      specified as a string.
      >
      as fonts are specified to the browser via a style command, not sure why
      you
      do not just support a style and class (CSSClass) properties.
      >
      >
      -- bruce (sqlwork.com)
      >
      >
      "Nathan Sokalski" wrote:
      >
      >I have a System.Web.UI.C ontrol which has a property of type
      >System.Drawing .Font. When editing this control in an *.aspx file, how do
      >I
      >assign a value to this property? If I recall correctly, the attributes in
      >the server tag are a combination of the property name and the property of
      >that property separated by a "-" or something. However, I would also like
      >to
      >be able to use the Property Grid to do this. I tried using the Browsable
      >attribute for the property, but that did not seem to help. Here is my
      >current code for the property:
      >>
      ><System.Compon entModel.Browsa ble(True)WriteO nly Property Font() As
      >System.Drawing .Font
      > Set(ByVal value As System.Drawing. Font)
      > Me._font = value
      > End Set
      >End Property
      >>
      >Am I forgetting something? Any help would be appreciated. Thanks.
      >--
      >Nathan Sokalski
      >njsokalski@hotm ail.com
      >http://www.nathansokalski.com/
      >>
      >>
      >>

      Comment

      • John Saunders

        #4
        Re: Properties of Properties

        You should be able to work with this property in the property grid. The
        System.Drawing. Font type has an associated editor, which the property grid
        should expose to you.

        What happens in the property grid?
        --
        John Saunders | MVP - Connected System Developer

        Comment

        • Nathan Sokalski

          #5
          Re: Properties of Properties

          All the Property Grid shows is the name of the property and a place to enter
          a value. It shows up the same way a property of type String or Integer or
          would. Is there an Property Attribute I need to add to make the associated
          editor available? Thanks.
          --
          Nathan Sokalski
          njsokalski@hotm ail.com
          有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


          "John Saunders" <no@dont.do.tha t.comwrote in message
          news:e3%23nmoFO JHA.4128@TK2MSF TNGP05.phx.gbl. ..
          You should be able to work with this property in the property grid. The
          System.Drawing. Font type has an associated editor, which the property grid
          should expose to you.
          >
          What happens in the property grid?
          --
          John Saunders | MVP - Connected System Developer

          Comment

          Working...