<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx</link><description>Like many developers at Microsoft, I spend a good chunk of my free time writing tools, or fun little programs that use some new SDK, or even applications requested by friends or family to help them do some task better and/or faster. Many of these materialize</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#548871</link><pubDate>Fri, 10 Mar 2006 22:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:548871</guid><dc:creator>Perry Rapp</dc:creator><description>Very nice code snippet.&lt;br&gt;&lt;br&gt;I did something much like it -- thank you for the inspiration. &lt;br&gt;&lt;br&gt;* I combined the Load &amp;amp; Save loops into a single loop (LoadSaveSettings), with a direction value, so that new controls only need be added to one location.&lt;br&gt;&lt;br&gt;* I modifed the storage code for TextBoxes to encrypt (DPAPI) values in password text boxes (I'm testing on the SystemPasswordChar right now).&lt;br&gt;&lt;br&gt;* I used a Settings class, instead of RegKey, so I can abstract storing a string/value pair -- my version does that via a Settings class, which talks to a SettingsStorageProvider which it gets from a factory of such -- so that the decision whether to store via XML or registry can be made at a much higher level.&lt;br&gt;&lt;br&gt;* I return a FormSettings object from the single-line invocation (your Register) call, which can be ignored (for a one-line form solution, like yours), or caught, to adjust settings (eg, use customized entropy values for keys, or to use to save the settings at other points than the close).&lt;br&gt;&lt;br&gt;* I adjusted the save code to not save if the DlgResult is set to Cancel, as I don't like saving settings when user is cancelling a dialog.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=548871" width="1" height="1"&gt;</description></item><item><title>re: Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#430144</link><pubDate>Fri, 17 Jun 2005 16:15:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:430144</guid><dc:creator>Stephen Toub - MSFT</dc:creator><description>There's no easy way to modify the standard message box... your best bet would be to simply create a new form that has whatever features you want (including a checkbox) and then ShowDialog on it instead of doing MessageBox.Show.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=430144" width="1" height="1"&gt;</description></item><item><title>re: Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#430134</link><pubDate>Fri, 17 Jun 2005 15:38:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:430134</guid><dc:creator>Intel96</dc:creator><description>I want to save setting like your suggested in your class, but I want a checkbox on the messagebox to ask the user to save the setting.  Something like never asked this question again...&lt;br&gt;&lt;br&gt;How do you add this?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=430134" width="1" height="1"&gt;</description></item><item><title>Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#105765</link><pubDate>Thu, 01 Apr 2004 20:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:105765</guid><dc:creator>Forest Blog</dc:creator><description>&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=105765" width="1" height="1"&gt;</description></item><item><title>re: Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#105750</link><pubDate>Thu, 01 Apr 2004 20:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:105750</guid><dc:creator>KevinT</dc:creator><description>Nicely done! Thanks a lot for this, it is going to save me a lot of time :-P&lt;br&gt;&lt;br&gt;Incedently, if anyone wants to use this code in a class, they will need to use the following namespaces...&lt;br&gt;&lt;br&gt;using System;&lt;br&gt;using System.Windows.Forms;&lt;br&gt;using System.Reflection;&lt;br&gt;using System.Diagnostics;&lt;br&gt;using Microsoft.Win32;&lt;br&gt;&lt;br&gt;(just in case ppl get stuck)&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;KevinT&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=105750" width="1" height="1"&gt;</description></item><item><title>Saving Form Settings</title><link>http://blogs.msdn.com/b/toub/archive/2004/03/31/105230.aspx#105743</link><pubDate>Thu, 01 Apr 2004 20:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:105743</guid><dc:creator>Forest Blog</dc:creator><description>&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=105743" width="1" height="1"&gt;</description></item></channel></rss>