<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C# 411 &#187; Tips</title>
	<atom:link href="http://www.csharp411.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Mon, 19 Jul 2010 14:56:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Type Name &#8220;UITypeEditor&#8221; Not Found</title>
		<link>http://www.csharp411.com/type-name-uitypeeditor-not-found/</link>
		<comments>http://www.csharp411.com/type-name-uitypeeditor-not-found/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 23:56:33 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/type-name-uitypeeditor-not-found/</guid>
		<description><![CDATA[This is one of those “D’oh!” moments.&#160; You’re creating your own UITypeEditor.&#160; You know the UITypeEditor class is located in the System.Drawing.Design namespace.&#160; So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right?&#160; Wrong!&#160; When you compile your project, the following error may appear:
The type or namespace name [...]


Related posts:<ol><li><a href='http://www.csharp411.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/' rel='bookmark' title='Permanent Link: Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog'>Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog</a></li><li><a href='http://www.csharp411.com/web-service-ambiguous-type-question/' rel='bookmark' title='Permanent Link: Web Service Stumper: "Ambiguous Type"'>Web Service Stumper: "Ambiguous Type"</a></li><li><a href='http://www.csharp411.com/c-universal-type-converter/' rel='bookmark' title='Permanent Link: C# Universal Type Converter'>C# Universal Type Converter</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/type-name-uitypeeditor-not-found/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Drop Shadow to Borderless Form</title>
		<link>http://www.csharp411.com/add-drop-shadow-to-borderless-form/</link>
		<comments>http://www.csharp411.com/add-drop-shadow-to-borderless-form/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:32:23 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/add-drop-shadow-to-borderless-form/</guid>
		<description><![CDATA[When you create a Form with a border, Windows automatically draws a drop shadow around the form, as shown here:

However, if you set the form’s FormBorderStyle property to None, Windows draws neither the form border nor the drop shadow, as shown here:

 

So what if you don’t want a form border, but you do want [...]


Related posts:<ol><li><a href='http://www.csharp411.com/hide-form-from-alttab/' rel='bookmark' title='Permanent Link: Hide Form from Alt+Tab'>Hide Form from Alt+Tab</a></li><li><a href='http://www.csharp411.com/c-focus-textbox-on-form-load/' rel='bookmark' title='Permanent Link: C# Focus TextBox on Form Load'>C# Focus TextBox on Form Load</a></li><li><a href='http://www.csharp411.com/c-winforms-form-event-order/' rel='bookmark' title='Permanent Link: C# WinForms Form Event Order'>C# WinForms Form Event Order</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/add-drop-shadow-to-borderless-form/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get Temporary Directory</title>
		<link>http://www.csharp411.com/get-temporary-directory/</link>
		<comments>http://www.csharp411.com/get-temporary-directory/#comments</comments>
		<pubDate>Sat, 01 May 2010 15:32:05 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/get-temporary-directory/</guid>
		<description><![CDATA[To get the path of the current user's temporary folder, call the GetTempPath method in the System.IO namespace:
string tempPath = System.IO.Path.GetTempPath();
  
On Windows Vista and 7, this method will return the following path:

C:\Users\UserName\AppData\Local\Temp\



Related posts:C# Copy Folder RecursivelyCheck Valid File Path in C#Truncate File Path with Ellipsis


Related posts:<ol><li><a href='http://www.csharp411.com/c-copy-folder-recursively/' rel='bookmark' title='Permanent Link: C# Copy Folder Recursively'>C# Copy Folder Recursively</a></li><li><a href='http://www.csharp411.com/check-valid-file-path-in-c/' rel='bookmark' title='Permanent Link: Check Valid File Path in C#'>Check Valid File Path in C#</a></li><li><a href='http://www.csharp411.com/truncate-file-path-with-ellipsis/' rel='bookmark' title='Permanent Link: Truncate File Path with Ellipsis'>Truncate File Path with Ellipsis</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/get-temporary-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Convert Byte Array to String</title>
		<link>http://www.csharp411.com/c-convert-byte-array-to-string/</link>
		<comments>http://www.csharp411.com/c-convert-byte-array-to-string/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 00:47:57 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-convert-byte-array-to-string/</guid>
		<description><![CDATA[It’s easy to convert a byte array to a string.&#160; For an ASCII string, use the Encoding.ASCII.GetString static method:
byte[] buffer = new byte[10];
// todo: populate the buffer with string data
string s = Encoding.ASCII.GetString( buffer );
  


Related posts:Convert String to Byte ArrayC# Convert String to Stream, and Stream to StringRead File into Byte Array


Related posts:<ol><li><a href='http://www.csharp411.com/convert-string-to-byte-array/' rel='bookmark' title='Permanent Link: Convert String to Byte Array'>Convert String to Byte Array</a></li><li><a href='http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/' rel='bookmark' title='Permanent Link: C# Convert String to Stream, and Stream to String'>C# Convert String to Stream, and Stream to String</a></li><li><a href='http://www.csharp411.com/read-file-into-byte-array/' rel='bookmark' title='Permanent Link: Read File into Byte Array'>Read File into Byte Array</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-convert-byte-array-to-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert String to Byte Array</title>
		<link>http://www.csharp411.com/convert-string-to-byte-array/</link>
		<comments>http://www.csharp411.com/convert-string-to-byte-array/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:18:57 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/convert-string-to-byte-array/</guid>
		<description><![CDATA[It’s easy to convert a string to a byte array.&#160; For an ASCII string, use the Encoding.ASCII.GetBytes static method:
string s = &#34;Test String&#34;;
byte[] byteArray = Encoding.ASCII.GetBytes( s );
  


Related posts:C# Convert Byte Array to StringC# Convert String to Stream, and Stream to StringRead File into Byte Array


Related posts:<ol><li><a href='http://www.csharp411.com/c-convert-byte-array-to-string/' rel='bookmark' title='Permanent Link: C# Convert Byte Array to String'>C# Convert Byte Array to String</a></li><li><a href='http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/' rel='bookmark' title='Permanent Link: C# Convert String to Stream, and Stream to String'>C# Convert String to Stream, and Stream to String</a></li><li><a href='http://www.csharp411.com/read-file-into-byte-array/' rel='bookmark' title='Permanent Link: Read File into Byte Array'>Read File into Byte Array</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/convert-string-to-byte-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read File into Byte Array</title>
		<link>http://www.csharp411.com/read-file-into-byte-array/</link>
		<comments>http://www.csharp411.com/read-file-into-byte-array/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:13:37 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/read-file-into-byte-array/</guid>
		<description><![CDATA[It’s easy to read a file into a byte array.&#160; Just use the File.ReadAllBytes static method.&#160; This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file.
string filePath = @&#34;C:\test.doc&#34;;
byte[] byteArray = File.ReadAllBytes( filePath );
  


Related posts:C# Read Text File Line-by-LineC# Convert [...]


Related posts:<ol><li><a href='http://www.csharp411.com/c-read-text-file-line-by-line/' rel='bookmark' title='Permanent Link: C# Read Text File Line-by-Line'>C# Read Text File Line-by-Line</a></li><li><a href='http://www.csharp411.com/c-convert-byte-array-to-string/' rel='bookmark' title='Permanent Link: C# Convert Byte Array to String'>C# Convert Byte Array to String</a></li><li><a href='http://www.csharp411.com/convert-string-to-byte-array/' rel='bookmark' title='Permanent Link: Convert String to Byte Array'>Convert String to Byte Array</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/read-file-into-byte-array/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Set InitialDirectory for FolderBrowserDialog</title>
		<link>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</link>
		<comments>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:34:40 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</guid>
		<description><![CDATA[The .NET FolderBrowserDialog class does not have an InitialDirectory property like the OpenFileDialog class.&#160; But fortunately, it’s quite easy to set an initial folder in the FolderBrowserDialog:
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.RootFolder = Environment.SpecialFolder.Desktop;
dialog.SelectedPath = @&#34;C:\Program Files&#34;;
if (dialog.ShowDialog() == DialogResult.OK)
{
    Console.WriteLine( dialog.SelectedPath );
}

Note that you can choose other RootFolder’s like MyComputer and MyDocuments.&#160; [...]


Related posts:<ol><li><a href='http://www.csharp411.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/' rel='bookmark' title='Permanent Link: Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog'>Adding Assemblies to the Visual Studio &#34;Add Reference&#34; Dialog</a></li><li><a href='http://www.csharp411.com/console-output-from-winforms-application/' rel='bookmark' title='Permanent Link: Console Output from a WinForms Application'>Console Output from a WinForms Application</a></li><li><a href='http://www.csharp411.com/the-proper-way-to-show-the-wait-cursor/' rel='bookmark' title='Permanent Link: The Proper Way to Show the Wait Cursor'>The Proper Way to Show the Wait Cursor</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programmatically Set Decimal Places</title>
		<link>http://www.csharp411.com/programmatically-set-decimal-places/</link>
		<comments>http://www.csharp411.com/programmatically-set-decimal-places/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 19:51:01 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/programmatically-set-decimal-places/</guid>
		<description><![CDATA[It’s easy to programmatically set the number of decimal places in a decimal, float or double that is converted to a string.&#160; Use the ToString method with the “N” argument summed with the number of decimal places:
float value = 3.1415926F;
int decimalPlaces = 3;
string text = value.ToString( &#34;N&#34; + decimalPlaces );

Note that ‘decimalPlaces’ must be greater [...]


Related posts:<ol><li><a href='http://www.csharp411.com/c-decimal-literals-conversions-and-formatting/' rel='bookmark' title='Permanent Link: C# Decimal: Literals, Conversions and Formatting'>C# Decimal: Literals, Conversions and Formatting</a></li><li><a href='http://www.csharp411.com/having-pun-with-c/' rel='bookmark' title='Permanent Link: Having Pun with C#'>Having Pun with C#</a></li><li><a href='http://www.csharp411.com/in-c-a-string-is-a-string/' rel='bookmark' title='Permanent Link: In C#, a string is a String'>In C#, a string is a String</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/programmatically-set-decimal-places/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# WinForms Form Event Order</title>
		<link>http://www.csharp411.com/c-winforms-form-event-order/</link>
		<comments>http://www.csharp411.com/c-winforms-form-event-order/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 23:00:12 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-winforms-form-event-order/</guid>
		<description><![CDATA[Sometimes it’s important to understand the order of events that occur when a WinForms Form is opened, closed, shown or hidden.&#160; There are also a few “gotchas” that are important to know.
 

Form Open
Following is the order of events when a Form is opened.&#160; Note that the Form’s Visible and IsDisposed property values are listed [...]


Related posts:<ol><li><a href='http://www.csharp411.com/see-all-key-events-with-keypreview/' rel='bookmark' title='Permanent Link: See All Key Events with KeyPreview'>See All Key Events with KeyPreview</a></li><li><a href='http://www.csharp411.com/hide-form-from-alttab/' rel='bookmark' title='Permanent Link: Hide Form from Alt+Tab'>Hide Form from Alt+Tab</a></li><li><a href='http://www.csharp411.com/notifyiconshowballoontip-issues/' rel='bookmark' title='Permanent Link: NotifyIcon.ShowBalloonTip Issues'>NotifyIcon.ShowBalloonTip Issues</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-winforms-form-event-order/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C# Decimal: Literals, Conversions and Formatting</title>
		<link>http://www.csharp411.com/c-decimal-literals-conversions-and-formatting/</link>
		<comments>http://www.csharp411.com/c-decimal-literals-conversions-and-formatting/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:58:38 +0000</pubDate>
		<dc:creator>timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-decimal-literals-conversions-and-formatting/</guid>
		<description><![CDATA[The C# decimal keyword denotes a 128-bit data type.&#160; Compared to floating-point types, the decimal type has a greater precision and a smaller range, which makes it suitable for financial and monetary calculations.
Approximate Range: ±1.0 × 10−28 to ±7.9 × 1028
Precision:&#160; 28-29 significant digits
.NET Type:&#160; System.Decimal

 
Decimal Literal
If you want a numeric literal to be [...]


Related posts:<ol><li><a href='http://www.csharp411.com/programmatically-set-decimal-places/' rel='bookmark' title='Permanent Link: Programmatically Set Decimal Places'>Programmatically Set Decimal Places</a></li><li><a href='http://www.csharp411.com/in-c-a-string-is-a-string/' rel='bookmark' title='Permanent Link: In C#, a string is a String'>In C#, a string is a String</a></li><li><a href='http://www.csharp411.com/c-universal-type-converter/' rel='bookmark' title='Permanent Link: C# Universal Type Converter'>C# Universal Type Converter</a></li></ol>]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-decimal-literals-conversions-and-formatting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
