Re: Properties of Font-class are all read-only ???

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Pete Davis (pdavis68_at_hotmail.com)
Date: 03/15/04


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
>
>


Relevant Pages

  • Re: Leaving rasfc
    ... you know we get told to use Courier in manuscripts. ... I wouldn't submit a MS in some odd new esoteric font just ... A lot of the reasons for that insistence really should have ... And I've put "wordcount" between quotes because the editor, ...
    (rec.arts.sf.composition)
  • Re: Force split of unique long word in a narrow TD
    ... Without disclosing those reasons, and illustrating them with a URL, you can hardly expect to find a correct solution. ... The font size is ultimately under user's control. ... Words or codes? ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Timelines
    ... have a paid-for solution and I'm afrad Access is the way I need to go, ... various reasons! ... In what way can you not afford a free public domain font? ... Grouping in a continuous form can be fudged in a very ...
    (microsoft.public.access.modulesdaovba)
  • Re: OTish: The Secret Lives of Fonts
    ... Elaborate 'packaging' for a written piece = crap piece ... I used a word-processor rather than handwriting for two reasons. ... The second was just rearranging ideas and there's also a third: my handwriting is atrocious. ... The suggestion is made that it might well be the markers just didn't realise it was a different font, but 'felt' something subtly different about the work. ...
    (uk.comp.sys.mac)
  • Re: comp.lang.javascript FAQ - Quick Answers 2008-11-17
    ... practical reasons. ... No default font size is set, ... He may also employ a user stylesheet to make the FAQ layout fit his needs. ... evangelism: XHTML 1.0 Strict ...
    (comp.lang.javascript)