<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>C# Articles and Tutorials</title>
	<atom:link href="http://csharptuts.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://csharptuts.wordpress.com</link>
	<description>Where programming meets simplicity.</description>
	<lastBuildDate>Fri, 02 Oct 2009 22:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='csharptuts.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>C# Articles and Tutorials</title>
		<link>http://csharptuts.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://csharptuts.wordpress.com/osd.xml" title="C# Articles and Tutorials" />
	<atom:link rel='hub' href='http://csharptuts.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Iterating Through Collections &#8211; For/Foreach Loop</title>
		<link>http://csharptuts.wordpress.com/2009/10/02/iterating-through-collections-forforeach-loop/</link>
		<comments>http://csharptuts.wordpress.com/2009/10/02/iterating-through-collections-forforeach-loop/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:42:48 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Loops]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=29</guid>
		<description><![CDATA[Using the C#, For and Foreach Loop. A brief C# tutorial and guide.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=29&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome dear readers! Today I&#8217;ll be showing you clear-cut example about how to use the For and Foreach Loop statements.</p>
<p><span id="more-29"></span></p>
<p>C# is really powerful when it comes to loops and iterations. It allows it&#8217;s users to quickly and easily sift through collections of data and manipulate it in many ways.</p>
<p>First, we&#8217;ll see the For Loop.</p>
<p><em>for (int i = 0; i &lt; 10; i++)</em></p>
<p><em>{</em></p>
<p><em> Console.WriteLine(&#8220;Hello there, this is hello number:&#8221; + i.ToString());<br />
</em></p>
<p><em>}</em></p>
<p>So what exactly are we doing with this little program. We declare a variable of int type <strong><em>i</em></strong>, then we tell our loop <em><strong>how many times will you run before you&#8217;re done</strong></em>, and finally we tell our loop <em><strong>each time you finish a circuit, increase the count variable by X number.</strong></em> (<em>In this case, +1</em>)</p>
<p>You can use <strong>any</strong> type of variable to set the <strong>range</strong> of the For Loop. For instance:</p>
<p><em>string OurString = &#8220;Hello There&#8221;;</em></p>
<p><em>for (int i = 0; i &lt; OurString.Length; i++)</em></p>
<p><em>{</em></p>
<p><em> Console.WriteLine(&#8220;Print Hello)&#8221;;<br />
</em></p>
<p><em>}</em></p>
<p>The above For Loop will only iterate as many times as the count of the letters our string variable has. Beautiful thing, C# right?</p>
<p>Using the Foreach statement makes things much <strong>much</strong> better though.</p>
<p>Imagine that you have a string[] array of people&#8217;s names <em>OurNames</em>.</p>
<p><em>[Sergio, James, Edward, Lucy, Stephanie]</em> &#8211; These are our <em>string </em>objects inside of the string[] array.</p>
<p>What would you do if you wanted to add the word &#8220;<em>Smith</em>&#8221; to each name. Why you&#8217;d use the Foreach statement dear reader!</p>
<p><em>foreach(string i in OurNames)</em></p>
<p><em>{</em></p>
<p><em> i = i + &#8220;Smith&#8221;;<br />
</em></p>
<p><em>}</em></p>
<p>Really? Is it that simple? <strong>Yes it is.</strong> Let me break down a bit what&#8217;s going on in this loop. Think of it like this: <em>For each string I have in my OurName book, let&#8217;s call it &#8220;<strong>i</strong>&#8221; in this case, add the string &#8220;Smith&#8221; at the end of it.</em></p>
<p>Each time the cycle iterates the local variable declared (<em>in this case &#8220;i&#8221;</em>) will change itself to the value inside of your collection. If this is confusing just practice using different variable types. If you have an array of int values, you&#8217;d declare it like this:</p>
<p><em>foreach(int i in OurNumbers)</em></p>
<p><em>{</em></p>
<p><em> i = i + 1;<br />
</em></p>
<p><em>}</em></p>
<p>That, my friends, is the basics of the For and Foreach Loop. I hope you guys enjoyed this brief guide, if you have any questions or feedback please leave some comments.<strong> </strong>I love it when people leave comments, so please do!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=29&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/10/02/iterating-through-collections-forforeach-loop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorial &#8211; Making a TicTacToe Game</title>
		<link>http://csharptuts.wordpress.com/2009/09/30/tutorial-making-a-tictactoe-game/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/30/tutorial-making-a-tictactoe-game/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 16:22:02 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[tictactoe]]></category>
		<category><![CDATA[Windows Games]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=21</guid>
		<description><![CDATA[In this tutorial, you'll learn how to build a TicTacToe game from start to finish. You'll use Buttons, boolean flags and more! Now's your chance to see how fun it is to make things using C#.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=21&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OK, I finally have time to finish the tutorials I promised a week ago.</p>
<p>First up is the Tic-Tac-Toe tutorial. Instead of writing a bunch of code and making things much more difficult for my readers, I&#8217;m going to upload the complete solution (58kb) online where anyone can download it.</p>
<p>The download link is here: <a href="http://sharebee.com/0e0d3c34" target="_self">http://sharebee.com/0e0d3c34</a></p>
<p>It&#8217;s fairly easy to follow along and you&#8217;ll learn things like Casting, Foreach Statements, Boolean Flags.</p>
<p>I really hope you enjoy it. Please feel free to leave some feedback and let me know what topics you&#8217;d like me to cover.</p>
<p>Happy coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=21&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/30/tutorial-making-a-tictactoe-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
		<item>
		<title>Coming Up Tutorials: Tic-Tac-Toe, Lights Out and Hangman.</title>
		<link>http://csharptuts.wordpress.com/2009/09/21/coming-up-tutorials-tic-tac-toe-lights-out-and-hangman/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/21/coming-up-tutorials-tic-tac-toe-lights-out-and-hangman/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 17:42:35 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[hangman]]></category>
		<category><![CDATA[hangmen]]></category>
		<category><![CDATA[new tutorials]]></category>
		<category><![CDATA[tic-tac-toe]]></category>
		<category><![CDATA[tictactoe]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=18</guid>
		<description><![CDATA[Site Schedule: New game tutorials to be made!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=18&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be working on those three game tutorials for your reading pleasure. I&#8217;ll show you the entire process from top to bottom and you&#8217;ll learn some nice things along the way.</p>
<p>They&#8217;ll be ready in about 3-4 days so stay tuned!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=18&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/21/coming-up-tutorials-tic-tac-toe-lights-out-and-hangman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
		<item>
		<title>Loading a ComboBox with Data from a SQL Database.</title>
		<link>http://csharptuts.wordpress.com/2009/09/19/loading-a-combobox-with-data-from-a-sql-database/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/19/loading-a-combobox-with-data-from-a-sql-database/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 02:54:16 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[combobox]]></category>
		<category><![CDATA[databind]]></category>
		<category><![CDATA[dataset]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=10</guid>
		<description><![CDATA[Learn how to load a ComboBox with information directly from a Database! In this post you'll learn how to have a ComboBox control load data using a DataSet linked to a Service-Based Database.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=10&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Learn how to load a ComboBox with information directly from a Database! In this post you&#8217;ll learn how to have a ComboBox control load data using a DataSet linked to a Service-Based Database.</p>
<p><span id="more-10"></span></p>
<p>How can you easily load a comboBox with items from a SQL Database?</p>
<p>I&#8217;ll teach you how to do this very easily in this very brief tutorial.</p>
<p>Open up your Visual C# Express 2008, create a new <strong>Windows Application</strong> and drag a <strong>comboBox</strong> control from your toolbox onto the Form1.</p>
<p>Right Click your Project from the <strong>Solution Menu</strong> and click <em>Add -&gt; New Item -&gt; Service-Based Database</em>.</p>
<p>The IDE takes a little while to do it&#8217;s thing but once it&#8217;s done you should see a DataSet window pop up, just close that for now.</p>
<p>Now in your Database Explorer (<em>look for it in the View menu</em>), rightclick the folder icon and <em>Add a New Table</em>. Your screen should look like this now:</p>
<p><img class="alignnone size-medium wp-image-11" title="ss1" src="http://csharptuts.files.wordpress.com/2009/09/ss1.png?w=300&#038;h=81" alt="ss1" width="300" height="81" /></p>
<p>Now let&#8217;s create a table in our database. Create columns IDUser, Name. Make it looks like this:</p>
<p><img class="alignnone size-medium wp-image-13" title="ss2" src="http://csharptuts.files.wordpress.com/2009/09/ss2.png?w=300&#038;h=92" alt="ss2" width="300" height="92" /></p>
<p>Make sure that you set IDUser as the Primary Key of the table and as it&#8217;s identity.</p>
<p><img class="alignnone size-medium wp-image-14" title="ss3" src="http://csharptuts.files.wordpress.com/2009/09/ss3.png?w=300&#038;h=104" alt="ss3" width="300" height="104" /><img class="alignnone size-medium wp-image-15" title="ss4" src="http://csharptuts.files.wordpress.com/2009/09/ss4.png?w=300&#038;h=108" alt="ss4" width="300" height="108" /></p>
<p>Now close this tab, and it&#8217;ll prompt you to write a name. Name your table <em>FirstTable</em> and click OK.</p>
<p><strong>Whew!</strong> Ok, we&#8217;re done setting up our database. (<em>I promise it becomes second nature once you start doing it many times)</em></p>
<p>From the solution explorer, double click your created Dataset and a blue background window should popup. Drag your newly created database from the Database Explorer <strong>onto</strong> the blue-tinted pane.</p>
<p>Make your way to the Form1 and click on your comboBox. A little tag should appear on the upper-right side of the control. Click on it and select the following options:</p>
<p><img class="alignnone size-medium wp-image-16" title="ss5" src="http://csharptuts.files.wordpress.com/2009/09/ss5.png?w=300&#038;h=227" alt="ss5" width="300" height="227" /></p>
<p>Now when you launch your application your <strong>ComboBox</strong> will be loaded with information pulled directly from the Database!</p>
<p>See you next time!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=10&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/19/loading-a-combobox-with-data-from-a-sql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>

		<media:content url="http://csharptuts.files.wordpress.com/2009/09/ss1.png?w=300" medium="image">
			<media:title type="html">ss1</media:title>
		</media:content>

		<media:content url="http://csharptuts.files.wordpress.com/2009/09/ss2.png?w=300" medium="image">
			<media:title type="html">ss2</media:title>
		</media:content>

		<media:content url="http://csharptuts.files.wordpress.com/2009/09/ss3.png?w=300" medium="image">
			<media:title type="html">ss3</media:title>
		</media:content>

		<media:content url="http://csharptuts.files.wordpress.com/2009/09/ss4.png?w=300" medium="image">
			<media:title type="html">ss4</media:title>
		</media:content>

		<media:content url="http://csharptuts.files.wordpress.com/2009/09/ss5.png?w=300" medium="image">
			<media:title type="html">ss5</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Controls to your Application Programatically.</title>
		<link>http://csharptuts.wordpress.com/2009/09/18/adding-controls-to-your-application-programatically/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/18/adding-controls-to-your-application-programatically/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 03:13:37 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[dynamic controls]]></category>
		<category><![CDATA[winforms]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=8</guid>
		<description><![CDATA[Learn how to add controls dynamically to your WindowsForms application! Dead simple to understand!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=8&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Learn how to add controls dynamically to your WindowsForms application! Dead simple to understand!</p>
<p><span id="more-8"></span></p>
<p>It&#8217;s fairly simple to add controls to your WindowsForms application during editing time, but what about during the programs execution?</p>
<p>For instance, what if you want to make a textBox appear <strong>only</strong> when a user checks a CheckBox? I&#8217;ll show you a simple way to add controls, but first a little theory.</p>
<p>WindowsForms have special containers, like a Form or a Panel. They have an array where all the controls inside of it are listed [<em>a zero-based index]</em>. Adding a control is just a matter of adding a control to the <strong>Containers</strong> control collection.</p>
<p>Open up your IDE and drag a CheckBox control on your WindowsForm. Double-click it to create it&#8217;s CheckedChanged event handler. Any time the checkbox is ticked/unticked, the code inside of this event will run.</p>
<p>Write the following down inside of that event:</p>
<blockquote><p>TextBox OurNewControl = new TextBox();<br />
this.Controls.Add(OurNewControl);</p></blockquote>
<p>Now run your program and check the checkbox. Notice anything? Yeah, the textboxes are being created on top of each other. That&#8217;s because when you create a control from scratch the have a <strong>position of x,y as zero</strong>. That means that they will always be located on the top left corner of the container.</p>
<p>Here&#8217;s how to fix that glitch, delete your previous code and put this in so your code looks like this:</p>
<blockquote><p>int Y = 10;</p>
<p>private void checkBox1_CheckedChanged(object sender, EventArgs e)<br />
{<br />
TextBox OurNewControl = new TextBox();<br />
OurNewControl.Location = new Point(10,Y);<br />
Y = Y + 20;<br />
this.Controls.Add(OurNewControl);<br />
}</p></blockquote>
<p>Now your TextBoxes will be added dynamically with a Y position being increased every time someone clicks the CheckBox.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=8&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/18/adding-controls-to-your-application-programatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
		<item>
		<title>Opening a WindowsForm from another WindowsForm.</title>
		<link>http://csharptuts.wordpress.com/2009/09/18/opening-a-windowsform-from-another-windowsform/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/18/opening-a-windowsform-from-another-windowsform/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 02:58:48 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[showdialog]]></category>
		<category><![CDATA[winforms]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=5</guid>
		<description><![CDATA[In this tutorial you'll learn how to open a Form from inside of another Form! Easy to follow.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=5&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this tutorial you&#8217;ll learn how to open a Form from inside of another Form! Easy to follow.</p>
<p><span id="more-5"></span></p>
<p>When creating a Windows applications you&#8217;re probably making it using Forms. Forms are programmer-speak for <em>the window the user sees when using the software</em>.</p>
<p>Open up your Visual C# Express 2008 and create a new Windows Forms Application. It&#8217;s most likely called Form1. Drag a button on the form and double-click it to create it&#8217;s Click_event Handler. That&#8217;s just programmer-speak for <em>stuff that gets executed when someone clicks this button</em>.</p>
<p>So far, you should have: A single Form1, a button on that form, and the button&#8217;s event handler.</p>
<p>Go ahead and right click your project from the solution menu, most likely called: WindowsApplication1, and select <em>Add New -&gt; Windows Forms</em>. Name it anything you&#8217;d like.</p>
<p>Here&#8217;s comes the fun part.</p>
<p>Go back to your created event handler for your button on <strong>Form1</strong>, and write down the following <strong>inside of the event method</strong> [<em>assuming your other form is named Form2]:</em></p>
<blockquote><p>Form2 OurForm2Variable = new Form2();</p>
<p>OurForm2Variable.Show();</p></blockquote>
<p>And there you go! You&#8217;ve succesfuly opened another form from inside a form! Good job! (/pat pat)</p>
<p>One thing to keep in mind, if you&#8217;d like your user to finish doing something on the form you want to open use the .ShowDialog() method to keep the user from clicking anywhere else on the application.</p>
<p>I hoped you liked this brief tutorial. See you next time!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=5&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/18/opening-a-windowsform-from-another-windowsform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome to CSharpTuts!</title>
		<link>http://csharptuts.wordpress.com/2009/09/12/welcome-to-csharptuts/</link>
		<comments>http://csharptuts.wordpress.com/2009/09/12/welcome-to-csharptuts/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 23:30:04 +0000</pubDate>
		<dc:creator>papuccino1</dc:creator>
				<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://csharptuts.wordpress.com/?p=3</guid>
		<description><![CDATA[CSharpTuts first post! What is this blog going to be about? Who is this blog directed towards? What tools are we going to be using? All this and more, in this first exciting post from CSharpTuts.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=3&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to the first post here at CSharpTuts!</p>
<p>I have a lot of things planned out for this site and hopefully you&#8217;ll all enjoy (and learn) a thing or two about how to use C#. I won&#8217;t go much into the theory behind the language, I&#8217;m assuming most of you just want to read how to solve a common problem with a common solution.</p>
<p>We&#8217;ll start things off slowly with a beautiful tutorial on how to create a pretty decent Adress book using Windows Forms and Microsoft SQL Server 2008.</p>
<p>I won&#8217;t explain how to install these, but I can tell you they&#8217;re now available for free in their respective Express editions.</p>
<p>So sit tight, and get ready to start learning and making kick-ass software! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharptuts.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharptuts.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharptuts.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharptuts.wordpress.com&amp;blog=9450540&amp;post=3&amp;subd=csharptuts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharptuts.wordpress.com/2009/09/12/welcome-to-csharptuts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/33b8facec9c0fff143e19a0b96c297e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">papuccino1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
