<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Farooq Azam</title>
	
	<link>http://www.farooqazam.net</link>
	<description>My personal blog about Unity 3D, Game Development, C# Programming, Gaming and me.</description>
	<lastBuildDate>Tue, 04 Jun 2013 00:27:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/farooqazamblog" /><feedburner:info uri="farooqazamblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>farooqazamblog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>DayZ Standalone Leaked Version Overview</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/MqHw2JFTk5A/</link>
		<comments>http://www.farooqazam.net/dayz-standalone-leaked-version-overview/#comments</comments>
		<pubDate>Tue, 04 Jun 2013 00:25:27 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[Gaming]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=451</guid>
		<description><![CDATA[I grabbed a development version of DayZ Standalone that was leaked today on the internet and had a chance to take a good look at it. Picture above was taken at the start screen. I maxed out the graphics settings and started playing. It was pretty smooth apart from the random lag spikes every 5 seconds. [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://imgur.com/bZct28L"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/bZct28L.jpg" /></a></p>
<p>I grabbed a development version of DayZ Standalone that was leaked today on the internet and had a chance to take a good look at it. Picture above was taken at the start screen. I maxed out the graphics settings and started playing. It was pretty smooth apart from the random lag spikes every 5 seconds. But that&#8217;s expected to happen since the game is not even in alpha stage and it&#8217;s a development build.<span id="more-451"></span></p>
<p>First time I started playing I spawned in the water. Pretty sure this was just a random bug because it never happened again.</p>
<p><a href="http://imgur.com/DfoR6AU"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/DfoR6AU.jpg" /></a></p>
<p>Swam to the shore and continued walking. Graphics have improved quite a lot. Chernarus looks beautiful.</p>
<p><a href="http://imgur.com/BCB1hIt"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/BCB1hIt.jpg" /></a></p>
<p><a href="http://imgur.com/3Khaygg"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/3Khaygg.jpg" /></a></p>
<p><strong>ZOMBIES! </strong>Unfortunately, I played for a while but didn&#8217;t encounter any zombies or weapons. Zombies spawns very rarely (according to other people) maybe for some development reason. This is just an overview so I am not gonna go in much detail right now. I&#8217;ll make a more detailed post later.</p>
<p>I also saw some very interesting new things by digging into the files. <strong>Excretion!</strong> There was a category named &#8220;Excretion&#8221; that had particle effects and decals named &#8220;shit, vomit, piss&#8221; etc. I tried to open the textures but had no luck. I&#8217;ll make a more detail post about this later.</p>
<p><a href="http://imgur.com/a8Coumb"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/a8Coumb.jpg" /></a></p>
<p>Speaking of graphics, there&#8217;s has been a huge improvement in the interior design &amp; detail of buildings. There are some new buildings that have quite an open interior with 3/4 rooms.</p>
<p>The spawn locations inside buildings are much better now. Items doesn&#8217;t just spawn on the ground but under furniture, in windows, inside wardrobes etc.</p>
<p><a href="http://imgur.com/TGf4L4n"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/TGf4L4n.jpg" /></a></p>
<p><a href="http://imgur.com/dA8WYm3"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/dA8WYm3.jpg" /></a></p>
<p><a href="http://imgur.com/efAN0nJ"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/efAN0nJ.jpg" /></a></p>
<p>I am not sure if there were any outdoor item spawns because I didn&#8217;t notice any apart from car wrecks. Some pictures of items that spawn in car wrecks:</p>
<p><a href="http://imgur.com/rzOCPty"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/rzOCPty.jpg" /></a></p>
<p><a href="http://imgur.com/PiHXzL2"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/PiHXzL2.jpg" /></a></p>
<p>Inventory has been completely redesigned but it still looks like a just concept. On left side is ground/items-nearby and on the right side it shows your inventory. In the middle it shows a 3D avatar of your character; you can rotate it 360 degrees. This will come in handy on servers with third person disabled if you care about looks.</p>
<p><a href="http://imgur.com/eO4kFhv"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/eO4kFhv.jpg" /></a></p>
<p><a href="http://imgur.com/vlmk6DK"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/vlmk6DK.jpg" /></a></p>
<p>There is a new feature that allows you to pin items which will show on your HUD all the time. I don&#8217;t really know how this will be used and what plans they might have for this. Currently there are no shortcut keys for the pinned items. It will be good to have shortcut keys to use pinned items because say if you pin beans to the first slot then you can eat by pressing Ctrl+1 and so on.</p>
<p>Pictures below shows how the inventory works but there&#8217;s one other thing. Look at the character&#8217;s head, he&#8217;s wearing a head torch. That&#8217;s a new item. I never used it because it&#8217;s always day time.</p>
<p><a href="http://imgur.com/b0Le4MV"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/b0Le4MV.jpg" /></a></p>
<p><a href="http://imgur.com/8E1mD5y"><img title="Hosted by imgur.com" alt="" src="http://i.imgur.com/8E1mD5y.jpg" /></a></p>
<p>That&#8217;s about it for now. I will make a more detailed post or a video later today or tomorrow.</p>
<p>For more pictures see my <a href="http://imgur.com/a/PdEF7#0"><strong>Imgur Album</strong></a>.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/MqHw2JFTk5A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/dayz-standalone-leaked-version-overview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/dayz-standalone-leaked-version-overview/</feedburner:origLink></item>
		<item>
		<title>Working With Files in C#</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/Bt8KPCZgXJk/</link>
		<comments>http://www.farooqazam.net/working-with-files-in-csharp/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 19:59:24 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[create file]]></category>
		<category><![CDATA[delete file]]></category>
		<category><![CDATA[edit file]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[rename file]]></category>
		<category><![CDATA[system.io]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=413</guid>
		<description><![CDATA[In this tutorial we will be working with files. How to create a file, edit it, rename a file make a copy an existing file or move it etc. First thing you should do is to reference the System.IO namespace. All the classes that will help you handle files are located in this namespace. How to create a file [...]]]></description>
				<content:encoded><![CDATA[<p>In this tutorial we will be working with files. How to create a file, edit it, rename a file make a copy an existing file or move it etc.</p>
<p>First thing you should do is to reference the<em> System.IO</em> namespace.</p>
<p>All the classes that will help you handle files are located in this namespace.</p>
<pre class="brush: csharp; title: ; notranslate">
using System.IO;
</pre>
<h2>How to create a file and edit it?</h2>
<p>You can create a file like this:</p>
<pre class="brush: csharp; title: ; notranslate">
string path = @&quot;C:\test.txt&quot;;
File.Create(path);
</pre>
<p>This will create a file &#8220;test.txt&#8221; in<span id="more-413"></span> C: drive. <em>File.Create()</em> method can be used to create all kind of files. It returns a <em>FileStream </em>instance which you can use to work with the new file. I mean you can also write the above code as <em>FileStream stream = File.Create(path);</em></p>
<p>Remember, it is not a good practice to use <em>File.Create() </em>method without saving the <em>FileStream </em>reference in a variable. Because otherwise you won&#8217;t be able to close the stream and you will get this error if you work with the file:</p>
<blockquote><p><a href="http://i.imgur.com/0LQJa.jpg">The process cannot access the file because it is being used by another process</a>.</p></blockquote>
<p>Whenever you get that error check your code for streams that are not closed. Always close a stream using the <em>Close()</em> method when you are done with it. Or a recommended way is to use the <a title="Using statement" href="http://msdn.microsoft.com/en-us/library/yh598w02.aspx" target="_blank">using Statement</a> (I&#8217;ve used it below).</p>
<p>Okay, we have created a file but it is empty which makes it useless. Let&#8217;s add something to it:</p>
<pre class="brush: csharp; title: ; notranslate">
using (FileStream stream = File.Create(path))
{
   Byte[] text = new UTF8Encoding(true).GetBytes(&quot;Hello, World.&quot;);
   stream.Write(text, 0, text.Length);
}
</pre>
<p><em>FileStream </em>is not the best choice if you adding only text to a file. For more on the text files check the next part.</p>
<h2>How to create a text file or open a text file and edit it?</h2>
<p>Here we will use the <em>File.CreateText()</em> method to create the file<em>.</em> It returns a <em>StreamWriter</em> instance which allows you to write text to the file.</p>
<pre class="brush: csharp; title: ; notranslate">
string path = @&quot;C:\abc.txt&quot;;

// This makes a new file and then opens it for writing
using (StreamWriter writer = File.CreateText(path))
{
   // Write a string to the file
   writer.Write(&quot;Welcome.&quot;);

   // Write a line
   writer.WriteLine(&quot;Hello, World&quot;);
   writer.WriteLine(&quot;What's up?&quot;);
}

// Open an existing file and write to it
using (StreamWriter writer = File.Open(@&quot;C:\xyz.txt&quot;))
{
   //... write text
}

// To append to an existing file
using (StreamWriter writer = File.AppendText(@&quot;C:\xyz.text&quot;))
{
   //... write text
}
</pre>
<h2>How to copy, move, delete and rename a file?</h2>
<p>To move or copy a file you can use <em>File.Copy()</em> and <em>File.Move()</em> methods.</p>
<pre class="brush: csharp; title: ; notranslate">
// Current path of the file
string path = @&quot;C:\abc.txt&quot;;

// New path for the file
string newPath  = @&quot;F:\abc.txt&quot;;

// To avoid errors we shoud make sure the file exists.
if (File.Exists(path))
{
   // Copy the file
   File.Copy(path, newPath);

   // Move the file
   File.Move(path, newPath);

   // Delete the file
   File.Delete(path);
}
</pre>
<p>To rename a file we will use the <em>File.Move()</em> method:</p>
<pre class="brush: csharp; title: ; notranslate">
// You use the same path but only rename the filename
string currentName = @&quot;C:\abc.txt&quot;;
string newName  = @&quot;C:\xyz.txt&quot;;

File.Move(currName, newName);
</pre>
<p>If you have any questions please don&#8217;t hesitate to post a comment.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/Bt8KPCZgXJk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/working-with-files-in-csharp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/working-with-files-in-csharp/</feedburner:origLink></item>
		<item>
		<title>Simple Unity Game tutorial</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/dMqbmCjQsTM/</link>
		<comments>http://www.farooqazam.net/simple-unity-game-tutorial/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 19:00:36 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=374</guid>
		<description><![CDATA[In this tutorial I will teach you how to make a simple game. This tutorial is mainly aimed at users who are new to Unity. So let&#8217;s begin. First off create a new project if you haven&#8217;t already made one. Right-click inside your Project tab and click Import Package &#62; Character Controller. Click on &#8220;none&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-388" title="Cubes game" alt="Cubes game" src="http://www.farooqazam.net/wp-content/uploads/2011/11/cube-game-300x235.png" width="300" height="235" /></p>
<p>In this tutorial I will teach you how to make a simple game. This tutorial is mainly aimed at users who are new to Unity. So let&#8217;s begin.<span id="more-374"></span></p>
<p>First off create a new project if you haven&#8217;t already made one.</p>
<p>Right-click inside your Project tab and click Import Package &gt; Character Controller. Click on &#8220;none&#8221; at the bottom left and scroll down to the bottom. Under Scripts tick &#8220;MouseLook.cs&#8221;. This will import the MouseLook script. It will help us rotate the camera around using mouse movement.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/import-package.png"><img title="Import package" alt="Import package" src="http://www.farooqazam.net/wp-content/uploads/2011/11/import-package.png" width="679" height="364" /></a></p>
<p>Now that we&#8217;ve got the MouseLook script let&#8217;s attach it to our camera. Select the <em>MainCamera </em>in the <em>Hierarchy</em> and in the top menu go to Component &gt; Camera-Control &gt; MouseLook. Viola! Now if you play the game you can rotate the camera around by moving the mouse but our scene is empty and all you see is a blank blue background. Let&#8217;s design a simple level.</p>
<p>In the top menu go to GameObject &gt; Create Other &gt; Plane. In the<em> Inspector</em> set its x/y/z position to &#8220;0&#8243; and set its x/y/z scale to &#8220;2&#8243;, so our camera can see it. Hit Play and now you can see that if you move the mouse the camera will rotate!</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/plane.png"><img class="alignnone size-full wp-image-393" title="plane" alt="" src="http://www.farooqazam.net/wp-content/uploads/2011/11/plane.png" width="727" height="550" /></a></p>
<p>But its pretty dark in here, isn&#8217;t it? Let&#8217;s add a light so we can see things a little better.</p>
<p>Go to GameObject &gt; Create Other &gt; Point Light and use the following values:</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/point-light.png"><img class="alignnone size-full wp-image-384" title="Point Light" alt="Point Light" src="http://www.farooqazam.net/wp-content/uploads/2011/11/point-light.png" width="289" height="347" /></a></p>
<p>Play the game and you&#8217;ll see its not dark anymore.</p>
<p>So, now we&#8217;ve got a simple level and we can rotate the <em>Camera </em>using the mouse! But that&#8217;s not interesting. Let&#8217;s add some stuff we can interact with.</p>
<p>Go to GameObject &gt; Create Other &gt; Cube and in the <em>Inspector</em> set its x/y/z position to &#8220;X: 0, Y: 0.5, Z: 0&#8243;. Next go to Component &gt; Physics &gt; Rigidbody to make it a Rigidbody. Now it will be affected by gravity and it will respond to collisions with real time Physics etc. You can read more about Rigidbodies at the <a href="http://unity3d.com/support/documentation/Components/class-Rigidbody.html">Unity Documentation</a>.</p>
<p>Go to Edit &gt; Duplicate and make 5 copies of it so you&#8217;ll have 6 cubes in your scene. Position them like this:</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/cubes.png"><img class="alignnone size-full wp-image-385" title="Cubes" alt="Cubes" src="http://www.farooqazam.net/wp-content/uploads/2011/11/cubes.png" width="500" height="378" /></a></p>
<p>Now we&#8217;re gonna make the player throw a ball. Go to GameObject &gt; Create Other &gt; Sphere. We want the ball to be affected by gravity and want it to collide with cubes. So add a Rigidbody to it by going to Component &gt; Physics &gt; Rigidbody. Position the ball right in front of the cubes but not too close the cubes.</p>
<p>To make the player throw the ball we&#8217;ll need a script. In the Project tab click on Create &gt; Javascript, name it &#8220;ThrowScript&#8221;. Double click to edit the script and use this code:</p>
<pre class="brush: plain; title: ; notranslate">
// This variable will contain a refernce the ball
var ball : GameObject;

// Speed of the ball
var speed : float = 800f;

function Update ()
{
	// If the Space key is pressd, apply force on the ball in z-axis (forward)
	if(Input.GetKeyDown(&quot;space&quot;))
		ball.rigidbody.AddForce(0, 0, speed);
}
</pre>
<p>We&#8217;re almost done. In the <em>Project</em> tab drag the ThrowScript and drop it over the <em>MainCamera </em>in the <em>Hierarchy </em>to attach it to the camera. All we need to do now is to tell the script which ball to use. Select the <em>MainCamera</em> and scroll down to the ThrowScript in the Inspector and drag and drop the Sphere into the Ball variable.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/camera-throw.png"><img class="alignnone size-full wp-image-387" title="camera-throw" alt="" src="http://www.farooqazam.net/wp-content/uploads/2011/11/camera-throw.png" width="600" height="454" /></a></p>
<p>That&#8217;s it! Our simple game is now finished. Play the game and press space and you&#8217;ll see how the cubes react when the balls collides with them.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2011/11/cube-game.png"><img title="Cubes game" alt="Cubes game" src="http://www.farooqazam.net/wp-content/uploads/2011/11/cube-game.png" width="573" height="450" /></a></p>
<p>If you have any questions or tutorial requests post a comment below.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/dMqbmCjQsTM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/simple-unity-game-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/simple-unity-game-tutorial/</feedburner:origLink></item>
		<item>
		<title>Unity 3D Game Development tutorials coming soon!</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/sMgiRJXgqDI/</link>
		<comments>http://www.farooqazam.net/unity-3d-game-development-tutorials-coming-soon/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 20:52:16 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=363</guid>
		<description><![CDATA[I am currently working on an this game. I will post Unity tutorials in the next few weeks. If I had time I would make a video serious which will teach how to make a game like that.]]></description>
				<content:encoded><![CDATA[<p><iframe width="625" height="352" src="http://www.youtube.com/embed/pGBYuiz99cg?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>I am currently working on an this game. I will post Unity tutorials in the next few weeks.</p>
<p>If I had time I would make a video serious which will teach how to make a game like that.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/sMgiRJXgqDI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/unity-3d-game-development-tutorials-coming-soon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/unity-3d-game-development-tutorials-coming-soon/</feedburner:origLink></item>
		<item>
		<title>Image Viewer application using C#</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/0qEbatJt_MA/</link>
		<comments>http://www.farooqazam.net/image-viewer-application-using-c-sharp/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 19:00:45 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[image viewer]]></category>
		<category><![CDATA[picturebox]]></category>
		<category><![CDATA[rotate]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=126</guid>
		<description><![CDATA[A detailed tutorial about creating an Image Viewer or Picture Viewer application in C#. This application also converts Images from one type to another. Following are the features of this application: Open / Save images. Convert images. Rotate Images. All popular image formats are supported. Let&#8217;s get started! Setting up the Designer For this application [...]]]></description>
				<content:encoded><![CDATA[<p>A detailed tutorial about creating an Image Viewer or Picture Viewer application in C#. This application also converts Images from one type to another.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2009/09/image-viewer.gif"><img title="image-viewer" src="http://www.farooqazam.net/wp-content/uploads/2009/09/image-viewer-300x263.gif" alt="" width="270" height="237" /></a></p>
<p>Following are the features of this application:</p>
<ul>
<li>Open / Save images.</li>
<li>Convert images.</li>
<li>Rotate Images.</li>
<li>All popular image formats are supported.</li>
</ul>
<p>Let&#8217;s get started!<span id="more-126"></span></p>
<h3>Setting up the Designer</h3>
<p>For this application you will need an openFileDialog, saveFileDialog, pictureBox and a few buttons.</p>
<ol>
<li>Add openFileDialog and saveFileDialog to the form.</li>
<li>Use this filter for the openFileDialog and saveFileDialog: &#8221; JPEG File|*.jpg|GIF File|*.gif|PNG File|*.png|BMP File|*.bmp &#8220;</li>
<li>Add 4 buttons (<a title="Image Viewer" href="http://www.farooqazam.net/wp-content/uploads/2009/09/image-viewer.gif">refer to the image above</a>). Name the buttons just like I&#8217;ve did in that image.</li>
<li>Set the &#8220;Enabled&#8221; property for &#8220;Save&#8221; button to &#8220;False&#8221;. And set &#8220;Visible&#8221; to &#8220;False&#8221; for &#8220;RotateClockwise&#8221; and &#8220;RotateCounterclockwise&#8221; buttons.</li>
<li>Add a pictureBox and place it under the buttons (refer to the image above).</li>
</ol>
<p>That&#8217;s it. Now lets get on with the code.</p>
<h3>The Code</h3>
<p>First of all, add this code to the very top of your form:</p>
<pre class="brush: csharp; title: ; notranslate">

using System.Drawing.Imaging;

</pre>
<p>Declare these methods after the &#8220;public Form1() { &#8230;.&#8221; method:</p>
<pre class="brush: csharp; title: ; notranslate">// This method will be used to save the image

private void saveImage(string ext)
{
   ImageFormat format = null;

   if(ext == &quot;.gif&quot;)
      format = ImageFormat.Gif;
   else if(ext == &quot;.jpg&quot; || ext == &quot;.jpeg&quot;)
      format = ImageFormat.Jpeg;
   else if(ext == &quot;png&quot;)
      format = ImageFormat.Png;
   else if(ext == &quot;.bmp&quot;)
      format = ImageFormat.Bmp;

   pictureBox1.Image.Save(saveFileDialog1.FileName, format);
}

// This method will be used for rotating the image.
private void rotateImage(int angle)
{
   Bitmap img = new Bitmap(pictureBox1.Image);

   // 0 = Clockwise, 1 = counter-clockwise
   if (angle == 0)
      img.RotateFlip(RotateFlipType.Rotate90FlipNone);
   else if (angle == 1)
      img.RotateFlip(RotateFlipType.Rotate90FlipXY);

   pictureBox1.Size = img.Size;
   pictureBox1.Image = img;
}

</pre>
<p>Double-click the &#8220;Open&#8221; button to add the &#8220;Click()&#8221; event for it and use this code:</p>
<pre class="brush: csharp; title: ; notranslate">private void openBtn_Click(object sender, EventArgs e)
{
   DialogResult result = openFileDialog1.ShowDialog();

   if (result == DialogResult.OK)
   {
      Image img = Image.FromFile(openFileDialog1.FileName);

      // Assigns the opened image to picturebox.
      pictureBox1.Image = img;

      // Makes the pictureBox width/height same as the opened image.
      pictureBox1.Width = img.Width;
      pictureBox1.Height = img.Height;
   }

   // Enables the Save button.
   saveBtn.Enabled = true;

   // Shows the RotateClockwise and Counterclockwise buttons.
   rotateClockwise.Show();

   rotateCounter.Show();
 }</pre>
<p>Double-click the Save button and use this code:</p>
<pre class="brush: csharp; title: ; notranslate">private void saveBtn_Click(object sender, EventArgs e)
{
   DialogResult res = saveFileDialog1.ShowDialog();

   if (res == DialogResult.OK)
   {

      // Extracts the extension from the opened file.
      string ext = System.IO.Path.GetExtension(saveFileDialog1.FileName);

      ext = ext.ToLower();
      saveImage(ext);
   }
}</pre>
<p>Double-click the RotateClockwise button and use this code:</p>
<pre class="brush: csharp; title: ; notranslate">private void rotateClockwise_Click(object sender, EventArgs e)
{
   // Calls the rotateImage method and passes the parameter &quot;0&quot;
   // Refer to the rotateImage method to see how it works.
   rotateImage(0);
}

</pre>
<p>And lastly, double-click the Rotate Counterclockwise button and use this code:</p>
<pre class="brush: csharp; title: ; notranslate"> private void rotateCounter_Click(object sender, EventArgs e)
{
   // 1 = counter-clockwise
   rotateImage(1);
}

</pre>
<p>That&#8217;s it! We are done.</p>
<h3>Source Code</h3>
<p>ImageViewer Source – <a title="Download ScreenCapture class" href="../source/ImageViewer.zip"><strong>Download Now</strong></a> (42 Kb)</p>
<p><a title="Buy domain names" href="http://www.networksolutions.com">Buy domain names</a></p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/0qEbatJt_MA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/image-viewer-application-using-c-sharp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/image-viewer-application-using-c-sharp/</feedburner:origLink></item>
		<item>
		<title>Screen Capture Class For C#</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/QrQCNP49jbM/</link>
		<comments>http://www.farooqazam.net/screen-capture-class-for-c-sharp/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 20:30:46 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[screen capture]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=106</guid>
		<description><![CDATA[A class that will help you take screenshots quickly and easily. Following are the features of this class: Take screenshot of the whole screen Take screenshot of a particular area using a Rectangle Copy the screenshot to Clipboard. Save the screenshot straight after it is captured. All popular image formats are supported. How to use? [...]]]></description>
				<content:encoded><![CDATA[<p>A class that will help you take screenshots quickly and easily.</p>
<p><img title="ScreenCapture" src="http://www.farooqazam.net/wp-content/uploads/2009/09/ScreenCapture.gif" alt="ScreenCapture" width="396" height="233" /></p>
<p>Following are the features of this class:</p>
<ul>
<li>Take screenshot of the whole screen</li>
<li>Take screenshot of a particular area using a Rectangle</li>
<li>Copy the screenshot to Clipboard.</li>
<li>Save the screenshot straight after it is captured.</li>
<li>All popular image formats are supported.</li>
</ul>
<p><span id="more-106"></span></p>
<h3>How to use?</h3>
<p>To import this class into your C# project all you have to do is to drag and drop the “ScreenCapture.cs” file into your project.</p>
<p>It is very simple to use this class. Here’s an overview of all the features:</p>
<pre class="brush: csharp; title: ; notranslate">// Add this code to the top of your code
// i.e: add it above &quot;public Form1() { ......&quot;

SC.ScreenCapture SC = new SC.ScreenCapture();

// To take a screenshot of the whole screen
// Use this code:

SC.CaptureScreen();

// If you want to save the screenshot straight after it is taken
// Use this code:
// Replace &quot;C:\\screenshot.jpg&quot; with your own path

SC.CaptureScreen(@&quot;C:\screenshot.jpg&quot;);

// To take screenshot of a particular area
// Use this code:
// Replace &quot;Rect&quot; with a Rectangle

SC.CaptureRectangle(Rect);

// To save the screenshot straight after it is taken
// Use this code:
// Replace &quot;C:\screenshot-rect.jpg&quot; with your own path and &quot;Rect&quot; with a rectangle.

SC.CaptureRectangle(Rect, &quot;C:\\screenshot-rect.jpg&quot;);

// Note: Use the code below after you've taken a screenshot.
// To copy the screenshot to Clipboard
// Use this code

SC.CopyToClipboard();
</pre>
<p>The above instructions showed you all the features this class offers. However, if you want to see this class in acton. Then I’ve made a simple application for you, which uses this class. Download the class alone or the sample application below:</p>
<h3>Dowload the ScreenCapture class and a sample application</h3>
<blockquote><p>ScreenCapture Class – <a title="Download ScreenCapture class" href="../source/ScreenCapture-class.zip"><strong>Download Now</strong></a> (1 Kb)</p>
<p>Sample Application – <a title="Download Sample Application" href="../source/ScreenCapture-sample.zip"><strong>Download Now</strong></a> (46 Kb)</p></blockquote>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/QrQCNP49jbM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/screen-capture-class-for-c-sharp/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/screen-capture-class-for-c-sharp/</feedburner:origLink></item>
		<item>
		<title>C# – Check if connected to internet</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/QzXGlve25qg/</link>
		<comments>http://www.farooqazam.net/csharp-check-if-connected-to-internet/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 10:26:31 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=274</guid>
		<description><![CDATA[I was working on an application which checked for updates. I used WebRequest/WebResponse for checking updates. It showed a continuous Progressbar while checking for updates. But there was a problem. It worked properly when you were connected to internet but it  just showed the progressbar all the time if not connected. The solution for that was [...]]]></description>
				<content:encoded><![CDATA[<p>I was working on an application which checked for updates. I used WebRequest/WebResponse for checking updates. It showed a continuous Progressbar while checking for updates. But there was a problem. It worked properly when you were connected to internet but it  just showed the progressbar all the time if not connected.</p>
<p>The solution for that was to check for internet connection before checking for updates. If connected then check for updates otherwise show an error.</p>
<p>Checking for the state of internet connection is very simple. Let&#8217;s get started.</p>
<p><span id="more-274"></span></p>
<p>Firstly, import <em>System.Runtime.InteropServices</em> namespace. Add this to the top of your code:</p>
<pre class="brush: csharp; title: ; notranslate">using System.Runtime.InteropServices;</pre>
<p>Then use this code for checking connection state:</p>
<p><small><em>For C# Beginners: Add this code above or below public Form1() { &#8230; }</em></small></p>
<pre class="brush: csharp; title: ; notranslate">// API Method
[DllImport(&quot;wininet.dll&quot;)]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

// A method for checking the state
public static bool IsConnected()
{
    int Description;
    return InternetGetConnectedState(out Description, 0);
}</pre>
<p>Now you can use the above method to check for connection before doing anything that requires internet connection.</p>
<p>Example use:</p>
<pre class="brush: csharp; title: ; notranslate">// If internet connection is active
if (IsConnected())
{
    // do something
}
else
{
   MessageBox.Show(&quot;Please connect to the internet.&quot;);
</pre>
<p>If you have any questions please don&#8217;t hesitate to post a comment.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/QzXGlve25qg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/csharp-check-if-connected-to-internet/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/csharp-check-if-connected-to-internet/</feedburner:origLink></item>
		<item>
		<title>Crop Image – C# and VB.NET</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/dmsV5IBKhoI/</link>
		<comments>http://www.farooqazam.net/crop-image-c-sharp-and-vb-net/#comments</comments>
		<pubDate>Mon, 24 May 2010 04:00:00 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[bitmap]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=239</guid>
		<description><![CDATA[For cropping an image in C# &#38; VB.NET we can use the Graphics class. We&#8217;ll use a method (or function in VB.NET) which will take 2 parameters, a source image and a rectangle of the section that should be cropped.  Let&#8217;s code! The Code C#: VB.NET Explanation The above code will work perfectly but it [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.farooqazam.net/wp-content/uploads/2010/05/crop.gif"><img title="crop" src="http://www.farooqazam.net/wp-content/uploads/2010/05/crop.gif" alt="" width="350" height="234" /></a></p>
<p>For cropping an image in C# &amp; VB.NET we can use the <em>Graphics</em> class. We&#8217;ll use a method (or function in VB.NET) which will take 2 parameters, a source image and a rectangle of the section that should be cropped.  Let&#8217;s code!</p>
<p><span id="more-239"></span></p>
<h3>The Code</h3>
<p><strong><br />
C#:</strong></p>
<pre class="brush: csharp; title: ; notranslate">
public Bitmap CropImage(Bitmap source, Rectangle section)
{

 // An empty bitmap which will hold the cropped image
 Bitmap bmp = new Bitmap(section.Width, section.Height);

 Graphics g = Graphics.FromImage(bmp);

 // Draw the given area (section) of the source image
 // at location 0,0 on the empty bitmap (bmp)
 g.DrawImage(source, 0, 0, section, GraphicsUnit.Pixel);

 return bmp;
}

// Example use:

Bitmap source = new Bitmap(@&quot;C:\tulips.jpg&quot;);
Rectangle section = new Rectangle(new Point(12, 50), new Size(150, 150));

Bitmap CroppedImage = CropImage(source, section);
</pre>
<p><strong><br />
VB.NET</strong></p>
<pre class="brush: vb; title: ; notranslate">
Function CropImage(ByVal source As Bitmap, ByVal section As Rectangle) As Bitmap

 ' An empty bitmap which will hold the cropped image
 Dim bmp As New Bitmap(section.Width, section.Height)

 Dim g As Graphics = Graphics.FromImage(bmp)

 ' Draw the given area (section) of the source image
 ' at location 0,0 on the empty bitmap (bmp)
 g.DrawImage(source, 0, 0, section, GraphicsUnit.Pixel)

 return bmp
End Function

' Example use:

Dim source As New Bitmap(&quot;C:\tulips.jpg&quot;)
Dim section As New Rectangle(new Point(12, 50), new Size(150, 150))

Dim CroppedImage As Bitmap = CropImage(source, section)
</pre>
<h3>Explanation</h3>
<p>The above code will work perfectly but it seems confusing, doesn&#8217;t it? You might have been wondering how it works. Well&#8230;</p>
<p>We first make an empty bitmap of the same width/height as the <em>section</em> rectangle. This bitmap will hold the cropped image. We use the <em>section</em> rectangle&#8217;s width/height because it determines the size of the cropped image. Then we use the <em>Graphics</em> class&#8217;s <em>DrawImage()</em> method (function) for the cropping. It draws the given area (<em>section</em>) of the <em>source</em> image on the empty bitmap and that&#8217;s it. The <span style="text-decoration: line-through;">empty</span> bitmap now holds the cropped image.</p>
<h3>Source Code</h3>
<p><a href="http://www.farooqazam.net/source/CropImage-Csharp.zip">Download Source Code for C#</a></p>
<p><a href="http://www.farooqazam.net/source/CropImage-VB.zip">Download Source Code for VB.NET</a></p>
<p>If you have any questions, don&#8217;t hesitate to post a comment.</p>
<p>Thanks</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/dmsV5IBKhoI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/crop-image-c-sharp-and-vb-net/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/crop-image-c-sharp-and-vb-net/</feedburner:origLink></item>
		<item>
		<title>C# – Autocomplete Textbox</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/F04GOO07pU0/</link>
		<comments>http://www.farooqazam.net/c-sharp-autocomplete-textbox/#comments</comments>
		<pubDate>Sat, 15 May 2010 08:52:37 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[textbox]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=207</guid>
		<description><![CDATA[There are times when you&#8217;ll need an autocomplete textbox. Autocomplete textbox makes the user&#8217;s life easier. It shows suggestions as the user types. In case of a web browser, if you type &#8220;goo&#8221; it will automatically show all the suggestions starting with or containing &#8220;goo&#8221; like &#8220;Google, Goofy&#8221; etc. It really helps both you or [...]]]></description>
				<content:encoded><![CDATA[<p>There are times when you&#8217;ll need an autocomplete textbox. Autocomplete textbox makes the user&#8217;s life easier. It shows suggestions as the user types. In case of a web browser, if you type &#8220;goo&#8221; it will automatically show all the suggestions starting with or containing &#8220;goo&#8221; like &#8220;Google, Goofy&#8221; etc. It really helps both you or your users when hunting for something. Of course, it seems difficult to set up, but the reality is very different. So whether they&#8217;re typing in &#8220;<a href="http://www.o2.co.uk/broadband/">find O2 UK BROADBAND</a>&#8221; or you&#8217;re hunting for &#8220;that holiday video&#8221;, then your users are likely to find it a lot faster. Enough talk! Lets get on with it.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2010/05/auto-complete-textbox.gif"><img title="Autocomplete textbox" src="http://www.farooqazam.net/wp-content/uploads/2010/05/auto-complete-textbox.gif" alt="" width="369" height="215" /></a></p>
<p>Fortunately, textbox has a built-in autocomplete feature! We don&#8217;t have to do any coding.</p>
<p>You can either set it up from the Designer (if you are using Visual Studio or <a title="Sharp Develop" href="http://www.icsharpcode.net/opensource/sd/">#Develop</a>) or do it via code. It is simple both ways. Lets do it!<br />
<span id="more-207"></span></p>
<h3>Setting up AutoComplete</h3>
<p><a href="../wp-content/uploads/2010/05/auto-completes.gif"><img title="AutoComplete Properties" src="../wp-content/uploads/2010/05/auto-completes.gif" alt="" width="357" height="215" /></a></p>
<p>For setting up autocomplete you&#8217;ll have to use three properties of the TextBox class &#8212; AutoCompleteSource, AutoCompleteCustomSource and AutoCompleteMode. Here&#8217;s an explanation of these properties:</p>
<p><strong>AutoCompleteSource</strong> is the source of the suggestions. You can assign it CustomSource if you want to use custom suggestions or use other auto sources like FileSystem, HistoryList etc. Below are all the available sources:</p>
<ul>
<li><strong>FileSystem</strong>: This will show suggestions from the file system i.e files stored on the computer. Like if you write &#8220;C:\&#8221; it&#8217;ll show all the files stored on C: drive.</li>
<li><strong>FileSystemDirectories:</strong> This is same as FileSystem but it shows directory names instead of file names.</li>
<li><strong>HistoryList:</strong> This will show URLs from Internet Explorer&#8217;s history.</li>
<li><strong>RecentlyUsedList:</strong> A list of recently used applications, folders, and URLs (from internet explorer).</li>
<li><strong>AllUrl: </strong>This specifies an equivalent of HistoryList and RecentlyUsedList as the source.</li>
<li><strong>AllSystemSources:</strong> Specifies an equivalent of AllUrl and FileSystem as the source.</li>
</ul>
<p><strong>AutoCompleteModes</strong> are of 3 types. Suggest, Append and SuggestAppend:</p>
<ul>
<li><strong>Suggest</strong> will show suggestions in a drop-down as the user types.</li>
<li><strong>Append</strong> will auto complete as you type. Like if you write &#8220;Goo&#8221; it&#8217;ll automatically make it &#8220;Google&#8221;.</li>
<li><strong>SuggestAppend</strong> will do both Suggest/Append.</li>
</ul>
<p><strong>AutoCompleteCustomSource</strong> is collection of custom suggestions. It will be used when you assign &#8220;CustomSource&#8221; as &#8220;AutoCompleteSource&#8221;.</p>
<p>Okay enough explanations. Lets make an autocomplete textbox now.</p>
<h3>Using Designer:</h3>
<p>If you are using the Designer, then all you have to do is to select your TextBox and change those three properties (explained above). For instance, if you want to use custom suggestions then use &#8220;CustomSource&#8221; and add the custom suggestions to &#8220;AutoCompleteCustomSource&#8221; (don&#8217;t forget to set up AutoCompleteMode). Debug your project and see! Its that easy <img src='http://www.farooqazam.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Don&#8217;t forget that you can also use all the other sources like FileSystem, HistoryList etc.</p>
<p><a href="http://www.farooqazam.net/wp-content/uploads/2010/05/auto-completes.gif"><img title="AutoComplete Properties" src="http://www.farooqazam.net/wp-content/uploads/2010/05/auto-completes.gif" alt="" width="357" height="215" /></a></p>
<h3>Via Coding:</h3>
<p>Here&#8217;s an example:</p>
<pre class="brush: csharp; title: ; notranslate">
// List of custom suggestions
string[] suggestions = new string[] {
&quot;Google&quot;,
&quot;Google Images&quot;,
&quot;Yahoo&quot;,
&quot;Youtube&quot;
};

// Use the AutoCompleteMode that suits you.
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;

// Since we are using custom suggestions you
// should use this source.
// Use the other non-custom sources if you
// don't want to use custom suggestions.
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;

// And finally add the above suggestions to the CustomSource
textBox1.AutoCompleteCustomSource.AddRange(suggestions);
</pre>
<p>That&#8217;s it.</p>
<p>If you have any questions, don&#8217;t hesitate to post a comment.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/F04GOO07pU0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/c-sharp-autocomplete-textbox/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/c-sharp-autocomplete-textbox/</feedburner:origLink></item>
		<item>
		<title>C# – Check if Form is already running</title>
		<link>http://feedproxy.google.com/~r/farooqazamblog/~3/-ChAt5Z-zsw/</link>
		<comments>http://www.farooqazam.net/c-sharp-check-if-form-is-already-running/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:02:35 +0000</pubDate>
		<dc:creator>Farooq Azam</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[running]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.farooqazam.net/?p=191</guid>
		<description><![CDATA[To check if a form is already running you&#8217;ll have to look for it in the Application.OpenForms collection. When a form is opened it is added to that collection. Here&#8217;s a boolean method that checks whether a form is open or not : Example use: Thanks. If you have any questions, don&#8217;t hesitate to post [...]]]></description>
				<content:encoded><![CDATA[<p>To check if a form is already running you&#8217;ll have to look for it in the Application.OpenForms collection. When a form is opened it is added to that collection.</p>
<p>Here&#8217;s a boolean method that checks whether a form is open or not :</p>
<pre class="brush: csharp; title: ; notranslate">
private bool CheckForm(Form form)
{
   foreach (Form f in Application.OpenForms)
       if (form == f)
          return true;

 return false;
}
</pre>
<p>Example use:</p>
<pre class="brush: csharp; title: ; notranslate">
// if form2 is not running

if (!CheckForm(form2))
  {
      // do something
  }
</pre>
<p>Thanks.</p>
<p>If you have any questions, don&#8217;t hesitate to post a comment.</p>
<img src="http://feeds.feedburner.com/~r/farooqazamblog/~4/-ChAt5Z-zsw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.farooqazam.net/c-sharp-check-if-form-is-already-running/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.farooqazam.net/c-sharp-check-if-form-is-already-running/</feedburner:origLink></item>
	</channel>
</rss>
