Jacob
Mon Apr 26 16:02:13 CDT 2004
Emmet Cummings wrote:
> I have a usercontrol that resizes itself based on the font size. When you
> enter the font in the property grid the control resizes itself correctly
> in design mode, but when the application is run, it uses the default
> font. So my question is how do I get at the font entered in the property
> grid for when I run the app. Where is that info stored?
It sounds as though the Font change isn't being serialized, which is odd.
You'll need to implement two methods:
(code assumes that the property is named Font)
Private Sub ResetFont()
'Set the Font to the default value here
End Sub
Private Function ShouldSerializeFont() As Boolean
'Check the current value of the font versus the default. If they're
different, return True, else False.
End Function
--
Jacob Grass
Microsoft .NET MVP
Check out
http://windowsforms.net