complex properties (font) on composite controls

Discussion in 'ASP .Net Building Controls' started by Gentian Hila, Jan 5, 2006.

  1. Gentian Hila

    Gentian Hila Guest

    I have a control that is used to get a date (dropdown calendar) and is made
    up by a label and three dropdownlists. I overrided the Enabled property so
    when it is true/false all of the child controls are Enabled/Disabled.
    That was easy. But now I need to change the text size of the composite
    control.When I do that, only the text size of the label changes.
    If the size would be a property of the WebControls that would be easy. Just
    override it and that's it. But size is a subproperty of Font.
    How can I make it work ? Any help is appreciated

    Thank you
     
    Gentian Hila, Jan 5, 2006
    #1
    1. Advertising

  2. I have not tried myself, but why not create a Font property and pass it onto
    your controls? Or create a TextSize property and update the Font of your
    internal controls in that...

    "Gentian Hila" wrote:

    > I have a control that is used to get a date (dropdown calendar) and is made
    > up by a label and three dropdownlists. I overrided the Enabled property so
    > when it is true/false all of the child controls are Enabled/Disabled.
    > That was easy. But now I need to change the text size of the composite
    > control.When I do that, only the text size of the label changes.
    > If the size would be a property of the WebControls that would be easy. Just
    > override it and that's it. But size is a subproperty of Font.
    > How can I make it work ? Any help is appreciated
    >
    > Thank you
     
    Sergey Poberezovskiy, Jan 9, 2006
    #2
    1. Advertising

  3. If you control is inheriting from WebControl, look at the documentation for
    the CopyBaseAttributes() method. This method can be used to copy all the
    standard display attributes from your control to its member controls.
    --Ken

    "Sergey Poberezovskiy" <> wrote
    in message news:...
    >I have not tried myself, but why not create a Font property and pass it
    >onto
    > your controls? Or create a TextSize property and update the Font of your
    > internal controls in that...
    >
    > "Gentian Hila" wrote:
    >
    >> I have a control that is used to get a date (dropdown calendar) and is
    >> made
    >> up by a label and three dropdownlists. I overrided the Enabled property
    >> so
    >> when it is true/false all of the child controls are Enabled/Disabled.
    >> That was easy. But now I need to change the text size of the composite
    >> control.When I do that, only the text size of the label changes.
    >> If the size would be a property of the WebControls that would be easy.
    >> Just
    >> override it and that's it. But size is a subproperty of Font.
    >> How can I make it work ? Any help is appreciated
    >>
    >> Thank you
     
    Ken Baltrinic, Jan 19, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sleigh
    Replies:
    1
    Views:
    2,712
    sleigh
    Feb 12, 2004
  2. Ziyad Makki
    Replies:
    0
    Views:
    315
    Ziyad Makki
    Jul 20, 2004
  3. mttc
    Replies:
    2
    Views:
    2,431
    Roedy Green
    Jul 3, 2009
  4. Matt T.

    Composite Control - Viewstate management for complex properties

    Matt T., Sep 7, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    225
    Teemu Keiski
    Sep 11, 2004
  5. Paul Yanzick
    Replies:
    4
    Views:
    519
    Steven Cheng[MSFT]
    Jan 9, 2006
Loading...

Share This Page