C
Chris Oswald
Forgive me if this has already been answered. I have created a custom
control which inherits from Windows.Forms.Control. I want set a
default Font for the Font property when the control is originally
created in the designer. I set the default font in the constructor.
Except the designer ignores my information and draws the control with
the it's own font of "Tahoma", 9F, Regular. WTF! If I create some
dummy property called ButtonFont the font works just fine in the
designer. What is the deal?
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Font = New Font("Tahoma", 15.0F, FontStyle.Bold)
End Sub
Private _font As Font
Public Overrides Property Font() As Font
Get
Return _font
End Get
Set(ByVal value As Font)
_font = value
Me.Invalidate()
End Set
End Property
control which inherits from Windows.Forms.Control. I want set a
default Font for the Font property when the control is originally
created in the designer. I set the default font in the constructor.
Except the designer ignores my information and draws the control with
the it's own font of "Tahoma", 9F, Regular. WTF! If I create some
dummy property called ButtonFont the font works just fine in the
designer. What is the deal?
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Font = New Font("Tahoma", 15.0F, FontStyle.Bold)
End Sub
Private _font As Font
Public Overrides Property Font() As Font
Get
Return _font
End Get
Set(ByVal value As Font)
_font = value
Me.Invalidate()
End Set
End Property