Private m_Font As Font = New Font("arial", 8.0!, FontStyle.Regular, _
GraphicsUnit.Point)
Public Property [Font]() As Font
Get
Return m_Font
End Get
Set(ByVal Value As Font)
m_Font = Value
End Set
End Property
Private Function ShouldSerializeFont() As Boolean
Return Not (m_Font.SizeInPoints = 8.0! AndAlso _
m_Font.Style = FontStyle.Regular AndAlso _
m_Font.Name.ToLower = "arial")
End Function
Private Sub ResetFont()
m_Font = New Font("arial", 8.0!, FontStyle.Regular, _
GraphicsUnit.Point)
End Sub

Signature
Mick Doherty
http://dotnetrix.co.uk/nothing.html
> Hi,
>
[quoted text clipped - 5 lines]
> Thanks,
> Nick
Nick WAELTI - 09 May 2005 09:24 GMT
Thanks :)
> Private m_Font As Font = New Font("arial", 8.0!, FontStyle.Regular, _
> GraphicsUnit.Point)
[quoted text clipped - 18 lines]
> GraphicsUnit.Point)
> End Sub
In C#, I would do something like this.
private static readonly Font DefaultFontValue = new Font("Arial", 8.0F,
FontStyle.Regular);
private Font font = null;
[AmbientValueAttribute(null)]
public override Font Font
{
get
{
if (font == null)
{
return DefaultFontValue;
}
return font;
}
set
{
if (font != value)
{
font = value;
this.Invalidate();
}
}
}
protected virtual bool ShouldSerializeFont()
{
return (font != null);
}

Signature
Tim Wilson
.Net Compact Framework MVP
> Hi,
>
[quoted text clipped - 5 lines]
> Thanks,
> Nick
Nick WAELTI - 09 May 2005 09:24 GMT
Thanks ;)
> In C#, I would do something like this.
>
[quoted text clipped - 27 lines]
> return (font != null);
> }