Problem w Font property in Custom Control

S

silverprox

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top