About changing a control's font .

Adel 21 Reputation points

In Windows Forms, when changing a control's font, does the control dispose the old one automatically?
If so, what if this font (the old one) is used elsewhere?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,734 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,459 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 79,836 Reputation points

    It disposes the current font handle and sets the new font handle to the control with WM_SETFONT
    You can see the source in control.cs, but not easy to folllow (search the calls to DisposeFontHandle)