Overriding Control.Font

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a problem that I have a solution for, but it seems messy

I have created a class that renders an image into a bitmap. I am in the process of creating controls as wrappers to provide design-time modification of the values (for both winforms and webforms). The image contains text, and the font to use is stored in my custom class. I do not need or desire to use the Control.Font property

The problem I am running into is that the Control.Font property cannot be overridden. Other than providing an additional font property for my custom class (which would just clutter up the property grid with unused properties), I can't think of a solution

Any suggestions

Paul K
 
You can create a designer that uses the PreFilterProperties method to remove
the Font property from your control.

--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

Paul K said:
I'm having a problem that I have a solution for, but it seems messy.

I have created a class that renders an image into a bitmap. I am in the
process of creating controls as wrappers to provide design-time modification
of the values (for both winforms and webforms). The image contains text,
and the font to use is stored in my custom class. I do not need or desire
to use the Control.Font property.
The problem I am running into is that the Control.Font property cannot be
overridden. Other than providing an additional font property for my custom
class (which would just clutter up the property grid with unused
properties), I can't think of a solution.
 
Back
Top