S
sadhu
Hi,
I'm developing a simple composite control with 2 child controls, a
Label and a TextBox. I expose easily many properties of the inner
controls, in the form i.e.:
BoxToolTip & LabelToolTip,
BoxForeColor & LabelForeColor,
BoxCssClass & labelCssClass...
but when I try to insert the BoxFont & LabelFont properties,
they correctly appears in the designer and it's apparently possible to
set them but no attribute like font-size="..." or font-family="..." is
wrote on the aspx page that holds the control. I can't set directly the
Font property of the child control, because it's readonly.
Here's the code:
[Browsable(true), Category("Appearance"), DefaultValue("")]
public FontInfo BoxFont
{
get
{
return box.Font;
}
set
{
FontInfo f = (FontInfo) value;
box.Font.Bold = f.Bold;
box.Font.Italic = f.Italic;
box.Font.Name = f.Name;
box.Font.Names = f.Names;
box.Font.Overline = f.Overline;
box.Font.Size = f.Size;
box.Font.Strikeout = f.Strikeout;
box.Font.Underline = f.Underline;
}
}
Thanx for yr kind answer
Silvano
I'm developing a simple composite control with 2 child controls, a
Label and a TextBox. I expose easily many properties of the inner
controls, in the form i.e.:
BoxToolTip & LabelToolTip,
BoxForeColor & LabelForeColor,
BoxCssClass & labelCssClass...
but when I try to insert the BoxFont & LabelFont properties,
they correctly appears in the designer and it's apparently possible to
set them but no attribute like font-size="..." or font-family="..." is
wrote on the aspx page that holds the control. I can't set directly the
Font property of the child control, because it's readonly.
Here's the code:
[Browsable(true), Category("Appearance"), DefaultValue("")]
public FontInfo BoxFont
{
get
{
return box.Font;
}
set
{
FontInfo f = (FontInfo) value;
box.Font.Bold = f.Bold;
box.Font.Italic = f.Italic;
box.Font.Name = f.Name;
box.Font.Names = f.Names;
box.Font.Overline = f.Overline;
box.Font.Size = f.Size;
box.Font.Strikeout = f.Strikeout;
box.Font.Underline = f.Underline;
}
}
Thanx for yr kind answer
Silvano