Re: Properties of Font-class are all read-only ???
From: Pete Davis (pdavis68_at_hotmail.com)
Date: 03/15/04
- Next message: John Underwood: "xml and tree node question"
- Previous message: Stoitcho Goutsev \(100\) [C# MVP]: "Re: How to get the character from the KeyCode?"
- In reply to: Christian Cambier: "Properties of Font-class are all read-only ???"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 15 Mar 2004 19:04:42 GMT
No, once you create a font, you can't change it. There are a number of
reasons for this, but it's all basically because that's the way fonts are
handled in Windows. A 12 point font and a 10 point font that are otherwise
identical are considered two entirely separate fonts.
Underneath, each has a separate font handle and thus the encapsulation in
.NET works the same way.
Pete
-- http://www.petedavis.net "Christian Cambier" <christianc@pandora.be> wrote in message news:_jl5c.36002$084.2422822@phobos.telenet-ops.be... > Hi, > > the following produces a compiler error : > > label1.Font.Size = 10; > > ==> ERROR:Property or indexer 'System.Drawing.Font.Size' cannot be > assigned to -- it is read only > > OK, but why has it been designed as read-only. As are all properties of the > Font-class by the way (???) > > Is there no way I can set the individual properties of a Font-object ? > > thnx > > Chris > >
- Next message: John Underwood: "xml and tree node question"
- Previous message: Stoitcho Goutsev \(100\) [C# MVP]: "Re: How to get the character from the KeyCode?"
- In reply to: Christian Cambier: "Properties of Font-class are all read-only ???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|