<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Rich Text Box Font</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Rich Text Box Font</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Tue, 21 May 2013 13:17:57 GMT</pubDate>
	<lastBuildDate>Tue, 21 May 2013 13:17:57 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>22</c9:totalResults>
	<c9:pageCount>-22</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>Can anyone tell me why in VB I have to go<br>
<br>
Me.RichTextBox1.Font = New Font(&quot;Times New Roman&quot;, 12, FontStyle.Regular)<br>
<br>
<br>
And not<br>
<br>
Me.RichTextBox1.Font = Font.Times New Roman<br>
<br>
or<br>
<br>
Me.RichTextBox1.Font = Font(&quot;Times New Roman&quot;, 12, FontStyle.Regular)<br>
<br>
<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/251720#251720</link>
		<pubDate>Fri, 26 Jan 2007 05:56:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/251720#251720</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>You have to do it that way because you are not just plugging the name of a font into a text field, you are assigning a resource to the RichTextBox.<br>
<br>
You have to actually create an instance of a font object and then point the RichTextBox at it.<br>
<br>
Yes it seems more complicated, but it also means that you can do things like have multiple controls use the same instance of a font object, not make their own copy among many other things.<br>
<br>
The same is true for many things, like mouse cursors.<br>
<br>
Jorgie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/2cbce460c3aa4cd0b9839dea01511577#2cbce460c3aa4cd0b9839dea01511577</link>
		<pubDate>Fri, 26 Jan 2007 08:40:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/2cbce460c3aa4cd0b9839dea01511577#2cbce460c3aa4cd0b9839dea01511577</guid>
		<dc:creator>Jorgie</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jorgie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>Thanks, its good to start to understand why.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0fc2286033de4f18992b9dea0151159e#0fc2286033de4f18992b9dea0151159e</link>
		<pubDate>Fri, 26 Jan 2007 15:35:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0fc2286033de4f18992b9dea0151159e#0fc2286033de4f18992b9dea0151159e</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>But if the rich text box has a font object *as part of it* (?)<br>
<br>
I.e. it uses a font object within its make-up<br>
<br>
Why can't I access that ?<br>
<br>
I know what you are saying. Your right. I'm just wonder why ?<br>
<br>
Or change the attribute of the font object that it points to ?<br>
<br>
<br>
The Font object has to be there ?????<br>
<br>
It makes sense the way that you do it. but ?<br>
<br>
Is it only text fields that you can change directly, everything else more complex, you have to create another instance of the class, an other object.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/a4a93aa7fe2748739b009dea015115c7#a4a93aa7fe2748739b009dea015115c7</link>
		<pubDate>Fri, 26 Jan 2007 16:26:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/a4a93aa7fe2748739b009dea015115c7#a4a93aa7fe2748739b009dea015115c7</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>SEP2007 wrote:</div>
<div>&#65279;But if the rich text box has a font object *as part of it* (?)<br>
<br>
I.e. it uses a font object within its make-up<br>
<br>
Why can't I access that ?<br>
</div>
</blockquote>
<br>
<br>
But you <u>can</u> access it, the RichTextBox.Font property has both a getter and a setter. However, if memory doesn't fail me, the Font class is immutable--you can't change the Font object's fields. So you can't just set Font.FontFamily. You have to create
 a new instance of Font and set that on the RichTextBox. That's a feature of Font, not RichTextBox.<br>
<br>
This probably works out well for RichTextBox, as it would like to know <u>when</u> the font changes, so forcing you to use a setter makes it clear when the font changed.&nbsp;Hypothetically,<br>
<br>
class RichTextBox<br>
{<br>
&nbsp;&nbsp;&nbsp; Font Font<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Ah, we're changing the font!<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _font = value;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InvalidateLayout(); // Force a layout and redraw.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _font;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
<br>
Or some such thing.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/845106cd75ee405baf8e9dea015115f5#845106cd75ee405baf8e9dea015115f5</link>
		<pubDate>Fri, 26 Jan 2007 19:01:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/845106cd75ee405baf8e9dea015115f5#845106cd75ee405baf8e9dea015115f5</guid>
		<dc:creator>amotif</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/amotif/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>a bit confused now.<br>
<br>
<br>
i understand that I could in theory,<br>
<br>
*set* the font name.<br>
<br>
and that doing so I would have to , inform the r.t.b to update itself.<br>
<br>
I just don't really, (or am trying to) understand *why* i have to do it that way [ first message ] .<br>
<br>
I seem right to do it that way.<br>
<br>
<br>
<br>
<br>
<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/6f35b5a77dc9453eaa7a9dea0151161e#6f35b5a77dc9453eaa7a9dea0151161e</link>
		<pubDate>Fri, 26 Jan 2007 19:13:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/6f35b5a77dc9453eaa7a9dea0151161e#6f35b5a77dc9453eaa7a9dea0151161e</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>SEP2007 wrote:</div>
<div>&#65279;a bit confused now.<br>
<br>
<br>
i understand that I could in theory,<br>
<br>
*set* the font name.<br>
<br>
and that doing so I would have to , inform the r.t.b to update itself.<br>
<br>
I just don't really, (or am trying to) understand *why* i have to do it that way [ first message ] .<br>
<br>
I seem right to do it that way.</div>
</blockquote>
<br>
<br>
From the looks of things, you're not familar with OOP (and VB6/VBS is not OOB), I recommend you start looking at the concept of
<a href="http://en.wikipedia.org/wiki/Type_system">Types</a> too (a prerequisite to OOP)<br>
<br>
Then you'll understand.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/5ec68eb4ed3c4f7893ad9dea01511647#5ec68eb4ed3c4f7893ad9dea01511647</link>
		<pubDate>Fri, 26 Jan 2007 19:29:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/5ec68eb4ed3c4f7893ad9dea01511647#5ec68eb4ed3c4f7893ad9dea01511647</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>OK</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/662d1938c04c4c00b3e89dea01511671#662d1938c04c4c00b3e89dea01511671</link>
		<pubDate>Fri, 26 Jan 2007 19:30:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/662d1938c04c4c00b3e89dea01511671#662d1938c04c4c00b3e89dea01511671</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>Lets try a silly example.<br>
<br>
You want to change the tire on your car. You can't just erase the name <em>FireStone</em> and write in
<em>GoodYear</em>, it would still be the same tire. You have to get your hands on a
<strong>New</strong> tire to replace the old one.<br>
<br>
The&nbsp;<strong>New</strong>&nbsp;method&nbsp;takes&nbsp;care of creating an instance of an object&nbsp;by allocating memory and any other resources needed by the object. If I am not mistaken, the opposite of
<strong>New</strong> in managed code is <strong>Dispose</strong>, but you don't have to worry about&nbsp;directly calling
<strong>Dispose</strong>&nbsp;most of the time, as the runtime will call the object's <strong>
Dispose</strong> method when it is no longer needed.<br>
<br>
Like the tire I mentioned above&nbsp;the font object tied to your text box is a 'specific instance' of a&nbsp;font. To replace it, you have to remove it and provide a new one.<br>
<br>
It is true that&nbsp;they could have over loaded the text box's font property&nbsp;to take a string that is the name of the font and then&nbsp;create new&nbsp;font resource and use it, but like many changes made to make things
<em>easier</em>, that would take some control away from the programmer.&nbsp; <br>
<br>
For example if you needed to&nbsp;switch back and forth between two fonts and the text box just took the name and size of the font and loaded them for you, it would be creating a new instance of the font every time you&nbsp;switched to it: (yes this is just pseudo code.)<br>
<br>
tb1.font = &quot;Arial 10pt&quot;; <br>
// new Arial font object created<br>
tb1.font = &quot;Times 10pt&quot;;<br>
//Arial font object thrown away, new Times font object created<br>
tb1.font = &quot;Arial 10pt&quot;;<br>
//Times font object thrown away, new Arial object created<br>
<br>
The way it actually works, you can just create the two fonts once, and switch between them: (again this is just pseudo code.)<br>
<br>
Font fArial = new Font(&quot;Arial&quot;,10);&nbsp; //create new Arial font object<br>
Font fTimes = new Font(&quot;Times&quot;,10pt); //create new Times font object<br>
tb1.font = fArial; //switch to&nbsp;Arial font, no new objects created<br>
tb1.font = fTimes; //switch to&nbsp;Times font, no new objects created<br>
tb1.font = fArial; //switch to&nbsp;Arial font, no new objects created<br>
<br>
Hope that helps. <br>
<br>
Jorgie<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/5eca5c3ccb12408fb3f59dea015116a2#5eca5c3ccb12408fb3f59dea015116a2</link>
		<pubDate>Fri, 26 Jan 2007 22:54:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/5eca5c3ccb12408fb3f59dea015116a2#5eca5c3ccb12408fb3f59dea015116a2</guid>
		<dc:creator>Jorgie</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jorgie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>Jorgie wrote:</div>
<div>The&nbsp;<strong>New</strong>&nbsp;method&nbsp;takes&nbsp;care of creating an instance of an object&nbsp;by allocating memory and any other resources needed by the object. If I am not mistaken, the opposite of
<strong>New</strong> in managed code is <strong>Dispose</strong>, but you don't have to worry about&nbsp;directly calling
<strong>Dispose</strong>&nbsp;most of the time, as the runtime will call the object's <strong>
Dispose</strong> method when it is no longer needed.</div>
</blockquote>
<br>
<br>
Dispose is only used by IDisposable for unmanaged resources used by managed classes. Whilst managed code has destructors, these are always called by the GC and not the user. Unlike C&#43;&#43; where you needed to call delete every time you called new, the CLR GC does
 this at the next GC interval once an object has no references to it.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/f3a8ae775e80436f9ba19dea015116d0#f3a8ae775e80436f9ba19dea015116d0</link>
		<pubDate>Sat, 27 Jan 2007 00:22:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/f3a8ae775e80436f9ba19dea015116d0#f3a8ae775e80436f9ba19dea015116d0</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>Jorgie wrote:</div>
<div>The&nbsp;<strong>New</strong>&nbsp;method&nbsp;takes&nbsp;care of creating an instance of an object&nbsp;by allocating memory and any other resources needed by the object. If I am not mistaken, the opposite of
<strong>New</strong> in managed code is <strong>Dispose</strong>, but you don't have to worry about&nbsp;directly calling
<strong>Dispose</strong>&nbsp;most of the time, as the runtime will call the object's <strong>
Dispose</strong> method when it is no longer needed.</div>
</blockquote>
<br>
<br>
Dispose is only used by IDisposable for unmanaged resources used by managed classes. Whilst managed code has destructors, these are always called by the GC and not the user. Unlike C&#43;&#43; where you needed to call delete every time you called new, the CLR GC does
 this at the next GC interval once an object has no references to it.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/41d5fed9d6534a3cb0919dea015116fd#41d5fed9d6534a3cb0919dea015116fd</link>
		<pubDate>Sat, 27 Jan 2007 00:47:16 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/41d5fed9d6534a3cb0919dea015116fd#41d5fed9d6534a3cb0919dea015116fd</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>I think that i get it.<br>
<br>
a font is an object, a non-divisable object.<br>
<br>
so you can't change the name of the font, you have to change the font, by creating a New font.<br>
<br>
<br>
*******<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/4b3436bd7cd0464887c69dea01511726#4b3436bd7cd0464887c69dea01511726</link>
		<pubDate>Sat, 27 Jan 2007 18:56:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/4b3436bd7cd0464887c69dea01511726#4b3436bd7cd0464887c69dea01511726</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>So<br>
<br>
<br>
aFont = New Font (created from font &quot;world&quot;) with attibutes (&quot;font-type&quot;,&quot;size,&quot;style&quot;)<br>
<br>
a New font is born.<br>
<br>
-&gt; then assigned to RichTextBox.<br>
<br>
poor font.<br>
<br>
<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/e14a8b38030548368aee9dea0151174f#e14a8b38030548368aee9dea0151174f</link>
		<pubDate>Sat, 27 Jan 2007 19:27:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/e14a8b38030548368aee9dea0151174f#e14a8b38030548368aee9dea0151174f</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0f7a3e94642f4ea4810a9dea015117c7#0f7a3e94642f4ea4810a9dea015117c7</link>
		<pubDate>Sat, 27 Jan 2007 21:00:02 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0f7a3e94642f4ea4810a9dea015117c7#0f7a3e94642f4ea4810a9dea015117c7</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><br>
.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0368c8be73924029b6519dea015117a0#0368c8be73924029b6519dea015117a0</link>
		<pubDate>Sun, 28 Jan 2007 00:32:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/0368c8be73924029b6519dea015117a0#0368c8be73924029b6519dea015117a0</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>So you couldn't change the font name, without killing the Font or Breaking the object. Putting in the new font name and &quot;putting it back together&quot;.<br>
<br>
Changing just the font name would be like organ transplant.<br>
<br>
Not good.<br>
<br>
<br>
<br>
<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/aa2c8e17410c4854adc69dea01511779#aa2c8e17410c4854adc69dea01511779</link>
		<pubDate>Sun, 28 Jan 2007 00:32:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/aa2c8e17410c4854adc69dea01511779#aa2c8e17410c4854adc69dea01511779</guid>
		<dc:creator>SEP2007</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SEP2007/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>W3bbo wrote:</div>
<div>&#65279;<br>
Dispose is only used by IDisposable for unmanaged resources used by managed classes. Whilst managed code has destructors, these are always called by the GC and not the user. Unlike C&#43;&#43; where you needed to call delete every time you called new, the CLR GC does
 this at the next GC interval once an object has no references to it.<br>
</div>
</blockquote>
<br>
<br>
That is strange. I use dispose on the fully managed Image object all the time. Using it seems to get old images cleaned up by the GC much faster.<br>
<br>
For example, I have a little tasktray app that is always running and changes my desktop every 15 minutes. Because XP wanted BMP files and most of my images are jpgs, I use an Image object to load the jpg and save it as a bmp in my profiles temp folder to be
 used as the current desktop. Even though the Image object goes out of scope right after I finish with it, if I don't call the images dispose function my memory use grows to 128MB or higher after running for 24hours or more. Once I started using the image objects
 dispose function, the application never uses more than 4BM.<br>
<br>
So there seems to be times when Dispose is useful even for manage objects. (It could be that having 2GB of RAM gives me enough headroom that the GC does not think it needs to be cleaned up.)<br>
<br>
It would be nice to know if there are any reasons NOT to use Dispose in cases like this because even the Image object documentation says &quot;This member supports the .NET Framework infrastructure and is not intended to be used directly from your code&quot; But does
 not elaborate.<br>
<br>
Jorgie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/2a6c851a2a324bec9f1d9dea015117f3#2a6c851a2a324bec9f1d9dea015117f3</link>
		<pubDate>Sun, 28 Jan 2007 04:10:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/2a6c851a2a324bec9f1d9dea015117f3#2a6c851a2a324bec9f1d9dea015117f3</guid>
		<dc:creator>Jorgie</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jorgie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>HMMM... now I am really confused, as I just found this:<br>
<br>
<a href="http://www.devx.com/dotnet/Article/33167/1954?pf=true">When and How to Use Dispose and Finalize in C#<br>
</a><br>
And it says:<br>
<br>
<strong>The Dispose Method—Explicit Resource Cleanup</strong><br>
Unlike Finalize, developers should call Dispose explicitly to free unmanaged resources. In fact, you should call the Dispose method explicitly on any object that implements it to free any unmanaged resources for which the object may be holding references. The
 Dispose method generally doesn't free managed memory—typically, it's used for early reclamation of only the unmanaged resources to which a class is holding references. In other words, this method can release the unmanaged resources in a deterministic fashion.<br>
<br>
So I need to find more info on Dispose.<br>
<br>
Jorgie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/dd814866cac04c609a129dea0151181c#dd814866cac04c609a129dea0151181c</link>
		<pubDate>Sun, 28 Jan 2007 04:16:57 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/dd814866cac04c609a129dea0151181c#dd814866cac04c609a129dea0151181c</guid>
		<dc:creator>Jorgie</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jorgie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>The Dispose method is used to release resources used by objects, while it's true that you can wait for GC to invoke the finalizer it's generally better to release resources you have obtained as soon as you finish with them, especially when the resource
 you have is particularly expensive or scarse, this is because you have no control over when GC invokes the finalizer, it could be five minutes, or fove hours.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/74f84034e3934a058dcd9dea01511861#74f84034e3934a058dcd9dea01511861</link>
		<pubDate>Sun, 28 Jan 2007 04:29:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/74f84034e3934a058dcd9dea01511861#74f84034e3934a058dcd9dea01511861</guid>
		<dc:creator>CrippledSmurf</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/CrippledSmurf/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p>Personally I was going to say finalize was the 'other side' of the constructor. Rather than Dispose, which is a method of granular resource cleanup, such as freeing up unmanaged objects.<br>
<br>
I could be wrong, but I've generally looked at it that way.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/35fd8c9440a9435b9cf99dea0151188c#35fd8c9440a9435b9cf99dea0151188c</link>
		<pubDate>Sun, 28 Jan 2007 11:46:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/35fd8c9440a9435b9cf99dea0151188c#35fd8c9440a9435b9cf99dea0151188c</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>Jorgie wrote:</div>
<div>&#65279; Even though the Image object goes out of scope right after I finish with it, if I don't call the images dispose function my memory use grows to 128MB or higher after running for 24hours or more. Once I started using the image objects dispose function,
 the application never uses more than 4BM.<br>
</div>
</blockquote>
<br>
<br>
There's a difference between managed <em>objects</em> and managed <em>memory. </em>
Even though Image is a managed class, it holds unmanaged resources (in this case, a handle to a GDI object where the bitmap is actually mapped. You can see this by opening
<a href="http://www.aisto.com/roeder/dotnet/">Reflector</a> and looking at the Dispose(Boolean) and FromFile(string) methods on the Image object. Lots of unmanaged memory mapping going on.<br>
<br>
Same thing goes for Stream objects - the object itself is managed, but it holds unmanaged resources (file handles and locks, in this case).<br>
<br>
In general principle, you can assume that if a framework class implements IDisposable, it probably holds some unmanaged resource and you SHOULD call Dispose() if you know you're done with it. When in doubt - Reflector. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/6193fc12dfab433e93d29dea015118b8#6193fc12dfab433e93d29dea015118b8</link>
		<pubDate>Sun, 28 Jan 2007 12:05:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/6193fc12dfab433e93d29dea015118b8#6193fc12dfab433e93d29dea015118b8</guid>
		<dc:creator>Yggdrasil</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Yggdrasil/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Rich Text Box Font</title>
		<description><![CDATA[<p><blockquote>
<div>Yggdrasil wrote:</div>
<div>&#65279;In general principle, you can assume that if a framework class implements IDisposable, it probably holds some unmanaged resource and you SHOULD call Dispose() if you know you're done with it. When in doubt - Reflector. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></div>
</blockquote>
<br>
<br>
<p>Or better yet, just use C#'s using(){} block.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/3c9cdc58776540a3b5429dea015118e1#3c9cdc58776540a3b5429dea015118e1</link>
		<pubDate>Sun, 28 Jan 2007 14:01:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/251720-Rich-Text-Box-Font/3c9cdc58776540a3b5429dea015118e1#3c9cdc58776540a3b5429dea015118e1</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>22</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>