<?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>Tayyab Bin Tariq</title>
	<atom:link href="http://tayyab.xenoglaux-solutions.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tayyab.xenoglaux-solutions.com</link>
	<description>I like sharing what i know</description>
	<lastBuildDate>Fri, 21 May 2010 20:59:02 +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>Arabian Idol: Our Arabic Language Project :)</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/#comments</comments>
		<pubDate>Fri, 21 May 2010 20:59:02 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/</guid>
		<description><![CDATA[WE had to produce a video as part of our Arabic Language Course, thought we would do something fun with it. Enjoy!    Starring:     Ali Jalil     Arif Sheikh     Maqsood Gul     Tayayb Bin Tariq     [...]]]></description>
			<content:encoded><![CDATA[<p>WE had to produce a video as part of our Arabic Language Course, thought we would do something fun with it. Enjoy!    <br />Starring:     <br />Ali Jalil     <br />Arif Sheikh     <br />Maqsood Gul     <br />Tayayb Bin Tariq     <br />Usman Fazal</p>
<p> <a href="http://picasaweb.google.com/lh/photo/Png5g4IaBg42mafy4uPGOg?feat=embedwebsite"><img src="http://lh4.ggpht.com/_jrIG2o7W8g0/S-PCT6KxKDI/AAAAAAAAA7c/IrN20dB8reM/s800/Arabic.jpg" /></a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/05/22/arabian-idol-our-arabic-language-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to block specific ports in Windows 7</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/#comments</comments>
		<pubDate>Sun, 09 May 2010 17:19:43 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Block ports in windows 7]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Port Blocking]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/</guid>
		<description><![CDATA[Hello everyone, I have learnt from some Facebook status updates that there is some internet explorer related security threat on the loose. It has also endangered IM like Yahoo and Skype. In this wake Microsoft has recommended that TCP ports 139 and 445 be blocked. Here is how to accomplish this in Windows 7;
 
1. [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, I have learnt from some <a href="http://facebook.com" target="_blank">Facebook</a> status updates that there is some internet explorer related security threat on the loose. It has also endangered IM like Yahoo and Skype. In this wake Microsoft has recommended that TCP ports 139 and 445 be blocked. Here is how to accomplish this in Windows 7;</p>
<p> <span id="more-202"></span>
<p>1. Go to <strong>Control Panel</strong> and open <strong>Windows</strong> <strong>Firewall</strong>.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image4.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb4.png" width="504" height="301" /></a> </p>
<p>2. Click on <strong>Advanced Settings</strong> in the left panel.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb5.png" width="504" height="362" /></a> </p>
<p>3. In the <strong>Advanced Settings</strong> panel, click on <strong>Inbound Rules</strong> in the left column.</p>
<p>4. In the <strong>Inbound Rules</strong> window, click on <strong>New Rule</strong> in the right column.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb6.png" width="504" height="362" /></a> </p>
<p>5. In the <strong>New Inbound Rule Wizard</strong>, select <strong>Port</strong> and click next.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb7.png" width="504" height="408" /></a> </p>
<p>6. In the next window, select the port type (TCP) and enter the port numbers separated by a coma and click Next. </p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb8.png" width="504" height="408" /></a> </p>
<p>7. In the next window, select <strong>Block the Connection</strong> and click next.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/05/image_thumb9.png" width="504" height="408" /></a> </p>
<p>8. Select all the domains you want to apply this rule to and click next.</p>
<p>9. Enter the name and description of the rule and click Finish. You are done!</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/05/09/how-to-block-specific-ports-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using unmanaged code/types from managed code</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/#comments</comments>
		<pubDate>Sat, 08 May 2010 15:00:22 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[managed code]]></category>
		<category><![CDATA[unmanaged code]]></category>
		<category><![CDATA[use managed code from unmanaged code]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/</guid>
		<description><![CDATA[You cannot declare a handle type in a native type. vcclr.h provides the type-safe wrapper template gcroot, to refer to a CLR object from the C++ heap. This template lets you embed a virtual handle in a native type and treat it as if it were the underlying type.
The gcroot template is implemented using the [...]]]></description>
			<content:encoded><![CDATA[<p>You cannot declare a handle type in a native type. vcclr.h provides the type-safe wrapper template gcroot, to refer to a CLR object from the C++ heap. This template lets you embed a virtual handle in a native type and treat it as if it were the underlying type.</p>
<p>The gcroot template is implemented using the facilities of the value class System::Runtime::InteropServices::GCHandle, which provides &quot;handles&quot; into the garbage-collected heap. Note that the handles themselves are not garbage collected and are freed when no longer in use by the destructor in the gcroot class (this destructor cannot be called manually). If you instantiate a gcroot object on the native heap, you must call delete on that resource.</p>
<p>The runtime will maintain an association between the handle and the CLR object, which it references. When the CLR object moves with the garbage-collected heap, the handle will return the new address of the object. A variable does not have to be pinned before it is assigned to a gcroot template.</p>
<p> <span id="more-192"></span><br />
<h2>Example</h2>
<p>This sample shows how to create a gcroot object on the native stack.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.83%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 252px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// mcpp_gcroot.cpp</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// compile with: /clr</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #cc6633">#include</span> &lt;vcclr.h&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> System;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">class</span> CppClass {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span>:</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   gcroot&lt;String^&gt; str;   <span style="color: #008000">// can use str as if it were String^</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   CppClass() {}</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> main() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   CppClass c;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   c.str = gcnew String(<span style="color: #006080">&quot;hello&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   Console::WriteLine( c.str );   <span style="color: #008000">// no cast required</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<h4>Output</h4>
<p>hello</p>
<p>This sample shows how to create a gcroot object on the native heap.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// mcpp_gcroot_2.cpp</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// compile with: /clr</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// compile with: /clr</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #cc6633">#include</span> &lt;vcclr.h&gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> System;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">struct</span> CppClass {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   gcroot&lt;String ^&gt; * str;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   CppClass() : str(<span style="color: #0000ff">new</span> gcroot&lt;String ^&gt;) {}</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   ~CppClass() { <span style="color: #0000ff">delete</span> str; }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> main() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   CppClass c;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   *c.str = gcnew String(<span style="color: #006080">&quot;hello&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   Console::WriteLine( *c.str );</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<h4>Output</h4>
<p><font face="cour">hello</font></p>
<p>This sample shows how to gcroot to hold references to value types (not reference types) in a native type by using gcroot on the boxed type.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// mcpp_gcroot_3.cpp</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// compile with: /clr</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #cc6633">#include</span> &lt; vcclr.h &gt;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> System;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> value <span style="color: #0000ff">struct</span> V {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   String^ str;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">class</span> Native {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span>:</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   gcroot&lt; V^ &gt; v_handle;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">};</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">int</span> main() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   Native native;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   V v;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   native.v_handle = v;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   native.v_handle-&gt;str = <span style="color: #006080">&quot;Hello&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   Console::WriteLine(<span style="color: #006080">&quot;String in V: {0}&quot;</span>, native.v_handle-&gt;str);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<h4>Output</h4>
<p>String in V: hello</p>
<p>Read original article <a href="http://msdn.microsoft.com/en-us/library/481fa11f%28VS.80%29.aspx" target="_blank">here.</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/05/08/using-unmanaged-codetypes-from-managed-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ten things you shouldn&#8217;t post to Facebook</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 16:24:50 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/</guid>
		<description><![CDATA[
It&#8217;s good to talk, so they say, and you know what? It&#8217;s good to share stuff too. Posting a few photos or a quick status update helps us stay connected with friends. Only trouble is, some people don&#8217;t know where to draw the line. 
And there is most definitely a line. Some things just don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="How many of these Facebook fails have you fallen foul of?(Dan &#13;&#10;Kitwood, Getty)" src="http://estb.msn.com/i/E6/5178D5D0D450BE3C956C8A28D76457.jpg" width="550" height="100" /></p>
<p>It&#8217;s good to talk, so they say, and you know what? It&#8217;s good to share stuff too. Posting a few photos or a quick status update helps us stay connected with friends. Only trouble is, some people don&#8217;t know where to draw the line. </p>
<p>And there is most definitely a line. Some things just don&#8217;t need to be shared via your Facebook page &#8211; especially since it might not be just your friends that see your latest update. Depending on how tight your privacy settings are, your status updates, wall posts and photos could all be available for anyone to see, regardless of whether or not you have friended them. </p>
<p>With that in mind, here are our top 10 things you should never reveal when social networking: how many of these <a href="http://tech.uk.msn.com/features/photos.aspx?cp-documentid=152212550&amp;page=1">Facebook fails</a> are you guilty of?</p>
<p> <span id="more-191"></span><br />
<h2>You are Having a Party</h2>
<p><img alt="You&#39;re having a party (Getty Images)" src="http://estb.msn.com/i/4E/E38E27CB8A7E327C8B6E567C1A010.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Getty Images</p>
<p>Facebook is great for organising meet-ups with your mates, but listing your private house party on there? Unless you&#8217;re up for the kind of shindig that involves hundreds of gategrashers ripping up the carpet and making off with the family silver, we&#8217;d suggest not. To be honest, we would have thought people had wised up to this one by now but, judging by the recent case of a <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=repair%20bill%20facebook%20party">16-year-old who listed his party on Facebook</a>, it appears not.</p>
<h2>You are off on a Holiday</h2>
<p><img alt="You&#39;re off on holiday (Microsoft)" src="http://estb.msn.com/i/11/E374E8A928BC8DFF7C6BB98BC465.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Microsoft</p>
<p>Time for a bit of sunshine? Good for you. You deserve it. Just try not to sign off for the fortnight with a status update along the lines of: &quot;Yippee! Off to Spain for two weeks tomorrow!&quot; It&#8217;s not that we&#8217;re jealous (honest), it&#8217;s just that putting that kind of information online is little better than slapping a &quot;not home for a fortnight&quot; poster on your front door. Even if you&#8217;ve taken the eminently sensible precaution of not including your address on your Facebook page, it can still be <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=finding+someone%27s+address+online&amp;go=&amp;form=QBRE&amp;filt=rf">easily found elsewhere online</a>.</p>
<h2>You are Doing Great at Farmville</h2>
<p><img alt="You&#39;re doing great at Farmville (Microsoft)" src="http://estb.msn.com/i/67/F4FFCBCCE789DAECEC26B5853414F2.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Microsoft</p>
<p>Time for a reality check, farmers. We don&#8217;t care that you found a golden egg in your imaginary cowshed or that your pretend crops are growing super-great after being watered by that good friend of yours. In fact, people care so little, there are now even browser plug-ins available that will prevent Farmville updates from showing in Facebook feeds. If you&#8217;re going to skive through your day on Farmville or its ilk, fair enough. Just turn off the auto-updates, please?</p>
<h2>You hate your Job</h2>
<p><img alt="You &#13;&#10;hate your job (Jesse Strigler Photography/Photographer&#39;s Choice/Getty &#13;&#10;Images)" src="http://estb.msn.com/i/5B/C7DB385EA652890821C3DB657BB.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Jesse Strigler Photography/Photographer&#8217;s Choice/Getty Images</p>
<p>Or your company, your boss or your customers. If you&#8217;re going to use your Facebook page as a vehicle for ranting about your daily occupation, you&#8217;d better make sure your privacy settings are ratcheted right up to the max or that you really don&#8217;t mind seeing your P45 pretty soon.</p>
<p>History is littered with the sackings of staff who made ill-advised comments about their workplace; from <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=virgin%20atlantic%20chav%20facebook">the airline staff who branded their passengers &#8216;chavs&#8217;</a> to the still-on-probation new starter who posted <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=woman%20sacked%20facebook%20insult">a foul-mouthed status update about her boss</a>, forgetting she had previously friended him. Don&#8217;t join them.</p>
<h2>You have 5000 friends on Facebook</h2>
<p><img alt="You&#39;ve got 5,000 friends (Microsoft)" src="http://estb.msn.com/i/9E/99A13816AAFE34CDAE981CEF41D24.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Microsoft</p>
<p>Some people collect Facebook &#8216;friends&#8217; with the same kind of fervent desperation with which they court Twitter followers. But it&#8217;s all for nowt, as it turns out our poor brains <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=150%20friends%20facebook">can only deal with up to 150 real mates</a>. Any more than that and you might find that while you&#8217;re bang up-to-date with what your window cleaner Steve&#8217;s weekend entails, your closest friend since childhood has become, um, thingummy. Remember, folks: a hulking friends list isn&#8217;t a sign of popularity, it&#8217;s just poor quality control.</p>
<h2>You have done something Stupid</h2>
<p><img alt="You&#39;ve done something stupid" src="http://estb.msn.com/i/23/D84DB7DB2DBB42D87ED95E0BDFF9A.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Practical jokes are all well and good, but just remember that some people might not see the funny side. Ask the seven staff from the accident and emergency department at Great Western Hospital in Swindon, Wiltshire, who found themselves temporarily suspended after <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=hospital%20staff%20lying%20down">allegedly playing the &#8216;lying down game&#8217;</a> and posting the pictures on Facebook. The doctors and nurses were said to have photographed themselves lying on resuscitation trolleys, ward floors and a helipad, a prank of which bosses at the hospital took a rather dim view.</p>
<h2>You are having an Affair</h2>
<p><img alt="You&#39;re having an affair (Hannes Hepp/Photonica/Getty Images)" src="http://estb.msn.com/i/ED/2C3267FEDEE1410613E9E678F0A9.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Hannes Hepp/Photonica/Getty Images</p>
<p>Facebook has become fertile ground for divorce lawyers, who are more than happy to pore over the site searching for indiscreet status updates and incriminating photos. A recent Stateside survey of the American Academy of Matrimonial Lawyers found that 81% of top US divorce lawyers have seen <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=facebook%20divorce%20american%20matrimonial%20lawyers">an increase in cases using social networking evidence</a> &#8211; with the bulk of those involving Facebook.</p>
<h1>You are on the run</h1>
<p><img alt="You&#39;re on the run (Microsoft)" src="http://estb.msn.com/i/39/D087A9C596AEED8ECE1AF52F9D1C74.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Microsoft</p>
<p>For every criminal mastermind, there are a thousand bungling goons. Want proof? Look no further than 28-year-old Craig Lynch, a convicted burglar who went on the run after absconding from a Suffolk open prison in September 2009. Presumably feeling rather smug about evading the law, <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=craig%20lynch%20facebook">Lynch taunted police</a> by regularly updating his Facebook page with details of what he was up to. Surprisingly, he managed to remain at large for a few months, before being finally reunited with his cell in January. Top tip for other would-be Lord Lucans: the idea is to lie low, understand?</p>
<h2>You are on Jury Duty</h2>
<p><img alt="You&#39;re on jury duty (Microsoft)" src="http://estb.msn.com/i/7D/8CBFDB63F6ADD3D9987189BA0938F.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>Microsoft</p>
<p>There are a few rules to abide by when sitting on a jury, but one of the real biggies is that you keep your mouth firmly zipped when outside the courtroom. As for posting about the case on your Facebook page, well that&#8217;s definitely right out.</p>
<p>Don&#8217;t put yourself in the position of one female juror, who was struggling to come to a decision on a child abuse case in 2008. &quot;I don&#8217;t know which way to go, so I&#8217;m holding a poll,&quot; the erstwhile juror wrote on her Facebook page. <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=facebook%20juror%20dismissed">Her removal from the jury swiftly followed</a>, after an anonymous tip-off to court officials.</p>
<h2>You are planning to pull a Sickie</h2>
<p><img alt="You&#39;re throwing a sickie (K2 Photography/Brand X Pictures/Getty &#13;&#10;Image)" src="http://estb.msn.com/i/BB/E6A6A828CB3FA99D4384B590427344.jpg" width="400" height="300" /></p>
<p><a>Larger image</a></p>
<p>K2 Photography/Brand X Pictures/Getty Image</p>
<p>Most of us know the feeling when the alarm clock goes off and the first thought to amble into our foggy brain is, &quot;I just can&#8217;t be bothered today&quot;. The occasional sickie can be one of life&#8217;s great pleasures but, again, it&#8217;s best kept to yourself rather than broadcast on Facebook. That is, if you want to keep your job.</p>
<p>A famous example involved Aussie call centre worker Kyle Doyle, who became a minor web celebrity after being memorably busted for skiving, after announcing his intention to <a href="http://www.bing.com/search?FORM=TECHSS&amp;mkt=en-gb&amp;q=kyle%20doyle%20facebook">pull a sickie on his Facebook status</a>.</p>
<p>Original article appeared <a href="http://tech.uk.msn.com/features/photos.aspx?cp-documentid=152212550" target="_blank">here</a>.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/25/ten-things-you-shouldnt-post-to-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matlab GUI-Radio Buttons: What I learnt Today?</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 15:03:25 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[WILT]]></category>
		<category><![CDATA[Matlab GUI]]></category>
		<category><![CDATA[matlab radio buttons]]></category>
		<category><![CDATA[radio  buttons]]></category>
		<category><![CDATA[What I Learnt Today?]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/</guid>
		<description><![CDATA[Introduction
 In this Matlab GUI Tutorial, you will learn how to use radio buttons, toggle buttons and the button group panel.
&#160;
 
Radio buttons and Toggle buttons are used exactly the same way that check boxes are used in Matlab GUIs, so we won’t go over how to use them. But there is one special case [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img hspace="10" alt="Matlab Logo" align="left" src="http://www.blinkdagger.com/tutorials/matlab/matlab-icon.jpg" /> In this Matlab GUI Tutorial, you will learn how to use radio buttons, toggle buttons and the button group panel.</p>
<p>&#160;</p>
<p> <span id="more-190"></span>
<p>Radio buttons and Toggle buttons are used exactly the same way that check boxes are used in Matlab GUIs, so we won’t go over how to use them. But there is one special case that needs to be covered. When either radio buttons or toggle buttons are used in conjunction with the button group panel, they exhibit mutually exclusive behavior. Simply put, this means that only one radio button or one toggle button can be selected at a time. This behavior can come in very useful for some GUIs. Since radio buttons and toggle buttons are identical in their functionality, what is said about one, is true for the other. Thus, only radio buttions will be discussed from here on out. </p>
<p>In this part of the tutorial, we will create a button group that will allow you to choose between different font sizes for the display text. </p>
<ol>
<li>
<p>The first thing we need to do is to add a <em>Button Panel</em> component to the GUI figure that we were just working with. So if you closed GUIDE, reopen it again. Once you have GUIDE opened again, click on <img border="1" alt="button panel icon" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/beginner/buttonpanel-icon.png" /> and add one <em>Button Panel</em> component to the GUI figure. Make sure it’s large enough to fit in three radio buttons. Next, click on <img border="1" alt="radio button icon" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/beginner/radiobutton-icon.png" /> and add three radio buttons onto the button group panel.</p>
</li>
<li>
<p>Double click on the first <em>Radio Button</em> component to bring up the Property Inspector. Change the <em>String</em> property to <code>8</code>. Change the <em>Tag</em> property to <code>fontsize08_radiobutton</code>. </p>
<p><img alt="Modify radio component properties" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/buttons/image019.png" /></p>
<p>Next, double click on the second <em>Radio Button</em> component, and change the <em>String</em> property to <code>12</code>, and change the <em>Tag</em> property to <code>fontsize12_radiobutton</code>. </p>
<p>Next, double click on the third <em>Radio Button</em> component, and change the <em>String</em> property to <code>16</code>, and change the <em>Tag</em> property to <code>fontsize16_radiobutton</code>. </p>
<p>Finally, double click on the button group panel and change the <em>Tag</em> property to <code>fontSelect_buttongroup</code>. You should also change the <em>String</em> property for the button group panel to <code>Fontsize</code>.</p>
</li>
<li>
<p>Here’s what your figure should look like after you add the components and modify them.</p>
<p><img alt="What your GUI figure should look like" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/buttons/image021.png" /></p>
</li>
<li>
<p>Before we move on, we should check the hierarchical structure of the GUI figure. Click on the <img border="1" alt="object browswer icon" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/buttons/objectBrowser-icon.png" /> icon and the followinging should appear:</p>
<p><img alt="object browswer " src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/buttons/objectBrowser.png" /></p>
<p>Make sure that the three radio buttons are one hierarchy below the button group icon.</p>
</li>
<li>
<p>Add the following line of code to the opening function. In this tutorial example, it is named <em>button_tutorial_OpeningFcn</em> function. Yours will be the name of the file you saved it as, followed by “_OpeningFcn”.</p>
<pre>set(handles.fontSelect_buttongroup,'SelectionChangeFcn',@fontSelect_buttongroup_SelectionChangeFcn);</pre>
<p>Make sure the previous line was added right before the line:</p>
<pre>guidata(hObject, handles);</pre>
<p>Next, add the following function at the very end of the .m file.</p>
<pre>function fontSelect_buttongroup_SelectionChangeFcn(hObject, eventdata)&#160;&#160; %retrieve GUI data, i.e. the handles structure
handles = guidata(hObject);&#160;&#160; switch get(eventdata.NewValue,'Tag')   % Get Tag of selected object
    case 'fontsize08_radiobutton'
      %execute this code when fontsize08_radiobutton is selected
      set(handles.display_staticText,'FontSize',8);&#160;&#160; case 'fontsize12_radiobutton'
      %execute this code when fontsize12_radiobutton is selected
      set(handles.display_staticText,'FontSize',12);&#160;&#160; case 'fontsize16_radiobutton'
      %execute this code when fontsize16_radiobutton is selected
      set(handles.display_staticText,'FontSize',16);
    otherwise
       % Code for when there is no match.&#160;&#160; end
%updates the handles structure
guidata(hObject, handles);</pre>
</li>
<li>
<p>Notice that the callback functions for the radio buttons were not automatically generated by Matlab. This is completely normal. Each time a button is selected within the <em>Button Group Panel</em> component, the function defined within the <em>SelectionChangeFcn</em> property of <em>Button Group Panel</em> component is called. The line of code that was added in the opening function specifies the callback function when a button within the button group is selcted. The selection change function is then defined at the end of the .m file.</p>
</li>
<li>
<p>Now that we’ve completed both the visual and code aspects of the GUI, its time to run the GUI again. Try clicking on all of the buttons to make sure they perform their function correctly. Specifically, make sure that the font size changes accordingly.</p>
<p><img alt="Buttons GUI" src="http://www.blinkdagger.com/tutorials/matlab/GUI/basic/buttons/image023.png" /></p>
</li>
</ol>
<p>And that’s it. Those are the basics of using the different buttons within the Matlab GUI.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/25/matlab-gui-radio-buttons-what-i-learnt-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arrays in C++</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 14:19:23 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Arrays of Arrays]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Jagged Arrays]]></category>
		<category><![CDATA[Managed C++]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/</guid>
		<description><![CDATA[Introduction
In some programs, you may need to represent a list of items that share some characteristics. You can declare as many variables as necessary to represent such items. Here is an example of 5 numbers declared in a program: 
// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In some programs, you may need to represent a list of items that share some characteristics. You can declare as many variables as necessary to represent such items. Here is an example of 5 numbers declared in a program: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    int number1 = 266;
    int number1 = -4683;
    int number1 = -364;
    int number1 = 1450;
    int number1 = 8;

    Console::WriteLine();
    return 0;
}</pre>
<p>If you want to use a group of objects that are of the same kind, C++ allows you to identify them as one variable. An array is a group of variables that shared the same characteristics. </p>
<h5>Note:</h5>
<p>
  <br />Arrays in Managed C++ are a little different than those traditionally used in C++ because the Microsoft .NET Framework introduced a new way of declaring and using arrays, which also has to do with inherited classes. Because this can be a long and arduous subject, we will use arrays only as they are used and implemented in managed classes.</p>
<h2>Array Declaration </h2>
<p>An array is a group of values of the same kind or the same data type. Because the items are considered in a group, they are declared as one variable but the declaration must indicate that the variable represents various items. The items that are part of the group are also referred to as members of the array. To declare an array, you must give it a name. </p>
<p>In C++, the formula to declare an array is </p>
<pre><i>DataType</i> <i>ArrayName</i>[<i>Dimension</i>];</pre>
<p>With this formula, an array would be declared as a value type. C++&#8217; arrays can be declared either on the stack as in the above formula or on the heap. Managed C++ formally introduces the idea of declaring an array on the heap. Based on this, (most) arrays in Managed C++ are referred to as managed arrays. In this case, the formula to declare a managed array is: </p>
<pre><i>DataType</i> <i>ArrayName</i>[] = new <i>DataType</i>[<i>Dimension</i>];</pre>
<p>Another equivalent formula is: </p>
<pre><i>DataType</i> <i>ArrayName</i> __gc[] = new <i>DataType</i> __gc[<i>Dimension</i>];</pre>
<p>Therefore, the declaration of a managed array starts by specifying a data type, the <i>DataType</i> in our syntax. This indicates the kind of values shared by the members of the array. It also specify the amount of memory space that each member of the array will need to store its value. Like any other variable, an array must have a name, which is the <i>ArrayName</i> in our syntax. The name of the array must be followed by an opening and a closing square brackets &quot;[]&quot;. To indicate that you are declaring a managed array, you must assign the same data type as a managed type, using the <b>new</b> keyword. Once again, the data type must be followed by square brackets. This time, inside of the square brackets, you must type the number of items that the array is made of; that is the <i>Dimension</i> in our syntax. </p>
<p>To create a managed array, the data type can be a normal C/C++ data type such as int, double, or .NET value type such as <b>Int32</b>, <b>Double</b>, etc. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double Number[] = new Double[5];

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>To re-enforce the idea of declaring a managed array, you can optionally type the <b>__gc</b> keyword to the left of the square brackets. You can type it either on only one side of the assignment operator or on both sides. Therefore, the following declarations are equivalents: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double Number1[]      = new Double[5];
    Double Number2 __gc[] = new Double[5];
    Double Number3[]      = new Double __gc[5];
    Double Number4 __gc[] = new Double __gc[5];

    Console::WriteLine();
    return 0;
}</pre>
<p>When declaring a managed array, you must use the <b>new</b> operator to indicate to the compiler that the variable would be declared on the heap. Because the <b>new</b> operator is explicit enough, you can omit the <b>__gc</b> keyword. Also, you don&#8217;t have to perform the whole declaration at the same time but you must have requested that memory be allocated to the array before it can be used. Based on this, you can first declare the variable with the left part of the assignment operator. Then, when you are ready, you can allocate memory to the variable and specify the number of members of the array. When doing this, type the name of the variable without the square brackets and type the right side of our syntax. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number[];
    // You can't yet use the array

    Console::WriteLine(S&quot;The Wonderful World of Managed C++!&quot;);

    number = __gc new Double[5];
    // Now the array is ready

    Console::WriteLine();
    return 0;
}</pre>
<p>We mentioned that, when declaring the array, you should specify the number of members of the array with the <i>Dimension</i> in our syntax. After declaring the array, if you want, you can reduce or increase the number of items by simply performing a new assignment to the variable and indicating the new desired <i>Dimension</i>. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number[];
    // You can't yet use the array

    Console::WriteLine(S&quot;The Wonderful World of Managed C++!&quot;);

    number = __gc new Double[5];
    // Now the array is ready

    // The new dimension of the array
    number = new Double[8];

    Console::WriteLine();
    return 0;
}</pre>
<h2>Initializing an Array</h2>
<p>When declaring an array, before using it, we saw that you must specify the number of members of the array. This declaration allocates an amount of memory space to the variable. The first member of the array takes a portion of this space. The second member of the array occupies memory next to it: </p>
<p><b>Array Variable</b></p>
<p>Member1<br />
  <br />Member2</p>
<p>Member3</p>
<p>Member4</p>
<p>Member5</p>
<p>Each member of the array can be accessed using its position. The position is also referred to as an index. The members of an array are arranged starting at index 0, followed by index 1, then index 2, etc. This system of counting is referred to as &quot;zero-based&quot; because the counting starts at 0. To locate a member, type the name of the variable followed by an opening and a closing square brackets. Inside the bracket, type the zero-based index of the desired member. After locating the desired member of the array, you can assign it a value, exactly as you would any regular variable. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number[] = __gc new Double[5];

    number[0] = 643.18;
    number[1] = 9.64;
    number[2] = 48.05;
    number[3] = 14.26;
    number[4] = 62.55;

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>In the same way, you can retrieve the value of a member of an array based on its index. Such a value can be displayed to the user as follows: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number[] = __gc new Double[5];

    number[0] = 643.18;
    number[1] = 9.64;
    number[2] = 48.05;
    number[3] = 14.26;
    number[4] = 62.55;

    Console::WriteLine(S&quot;Value 1: {0}&quot;, __box(number[0]));
    Console::WriteLine(S&quot;Value 2: {0}&quot;, __box(number[1]));
    Console::WriteLine(S&quot;Value 3: {0}&quot;, __box(number[2]));
    Console::WriteLine(S&quot;Value 4: {0}&quot;, __box(number[3]));
    Console::WriteLine(S&quot;Value 5: {0}&quot;, __box(number[4]));

    number = new Double[8];

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>This would produce: </p>
<pre>Value 1: 643.18
Value 2: 9.64
Value 3: 48.05
Value 4: 14.26
Value 5: 62.55

Press any key to continue</pre>
<p>When it comes to initializing a managed array, you don&#8217;t have to access each member of the array and initialize them individually. That technique is used if you don&#8217;t yet have the values of the items at the time you are declaring the array. If you know the values of the members of the managed array at the time you are declaring its variable, you can declare and initialize the whole array at the same time. The formula you would use is: </p>
<pre><i>DataType</i> <i>VariableName</i> __gc[] = { <i>Values Separated By Commas</i> };</pre>
<p>This formula is almost the same used in C/C++ with one difference. If you omit the <b>__gc</b> keyword, the array would be a regular one as used in C/C++. The alternative is to type the __gc keyword to the left of the square brackets. If you do this, two features would automatically be applied to your array. First, the array would be garbage collected, that is, cleaned up by the garbage collector; therefore becoming a managed array. Second, the array becomes automatically derived from the .NET&#8217;s Array class, which gives it access to the properties and methods of that class.</p>
<p>If you use the formula we used earlier with the number variable, the data type must be a .NET value type such as <b>Int32</b>, <b>Double</b>, <b>Single</b>, etc. If you use the above formula to declare and initialize your array, the data type can be a regular C/C++ type (such as <b>int</b>, long, or <b>double</b>) or a .NET value type (such as <b>Int32</b> or <b>Double</b>). Here is an example:</p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    double number __gc[] = { 79.31, 47.59, 749.75, 9.07, 9.44 };

    Console::WriteLine(S&quot;Value 1:  {0}&quot;, __box(number[0]));
    Console::WriteLine(S&quot;Value 2:  {0}&quot;, __box(number[1]));
    Console::WriteLine(S&quot;Value 3:  {0}&quot;, __box(number[2]));
    Console::WriteLine(S&quot;Value 4:  {0}&quot;, __box(number[3]));
    Console::WriteLine(S&quot;Value 5:  {0}&quot;, __box(number[4]));

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>This would produce:</p>
<pre>Value 1:  79.31
Value 2:  47.59
Value 3:  749.75
Value 4:  9.07
Value 5:  9.44

Press any key to continue</pre>
<h2>Multidimensional Arrays</h2>
<h2>Introduction</h2>
<p>The arrays we have used so far are referred to as single or one-dimensional arrays because they use a single group of items that can classified in a single column. In some cases, you may want to divided the list in two or more sections. For example, here is a list of numbers divided in various columns: </p>
<p>Sunday<br />
  <br />Monday</p>
<p>Tuesday</p>
<p>Wednesday</p>
<p>Thursday</p>
<p>Friday</p>
<p>Saturday</p>
<p>Week 1<br />
  <br />1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
<p>7</p>
<p>Week 2<br />
  <br />8</p>
<p>9</p>
<p>10</p>
<p>11</p>
<p>12</p>
<p>13</p>
<p>14</p>
<p>Week 3<br />
  <br />15</p>
<p>16</p>
<p>17</p>
<p>18</p>
<p>19</p>
<p>20</p>
<p>21</p>
<p>Week 4<br />
  <br />22</p>
<p>23</p>
<p>24</p>
<p>25</p>
<p>26</p>
<p>27</p>
<p>28</p>
<p>A multi-dimensional array is one that still includes items of the same type but the group is made of sub-divisions following an arrangement an arrangement of your choice. </p>
<h2>Two-Dimensional Arrays</h2>
<p>Imagine you create two lists of items declared in two variables as follows: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    <b>Double number1 __gc[] = new Double __gc[5];
    Double number2 __gc[] = new Double __gc[5];</b>

    number1[0] = 643.18;
    number1[1] = 9.64;
    number1[2] = -48.05;
    number1[3] = 14.26;
    number1[4] = 62.55;

    number2[0] = 124.45;
    number2[1] = -62.84;
    number2[2] = 508.06;
    number2[3] = 92.68;
    number2[4] = -44.82;

    Console::WriteLine(S&quot;Value 1:  {0}&quot;, __box(number1[0]));
    Console::WriteLine(S&quot;Value 2:  {0}&quot;, __box(number1[1]));
    Console::WriteLine(S&quot;Value 3:  {0}&quot;, __box(number1[2]));
    Console::WriteLine(S&quot;Value 4:  {0}&quot;, __box(number1[3]));
    Console::WriteLine(S&quot;Value 5:  {0}&quot;, __box(number1[4]));

    Console::WriteLine(S&quot;Value 6:  {0}&quot;, __box(number2[0]));
    Console::WriteLine(S&quot;Value 7:  {0}&quot;, __box(number2[1]));
    Console::WriteLine(S&quot;Value 8:  {0}&quot;, __box(number2[2]));
    Console::WriteLine(S&quot;Value 9:  {0}&quot;, __box(number2[3]));
    Console::WriteLine(S&quot;Value 10: {0}&quot;, __box(number2[4]));

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>Instead of having two lists that represent the same types of values, you can declare a single array variable and divide its list of items in two. A two-dimensional array is an array made of two lists of items of the same data type. To declare a two-dimensional array, use the following formula: </p>
<pre><i>DataType</i> <i>ArrayName</i>[,] = new <i>DataType</i>[<i>Dimension1,Dimension2</i>];</pre>
<p>Once again, you can optionally type the __gc keyword to the left of square brackets. The square brackets to the left of the assignment operator must have only a comma. Inside of the square brackets to the right side of the assignment, you must specify two numbers separated by a comma. The first number indicates the number of lists that the array contains. For a two-dimensional array, this number must be 2. The right value indicates the number of items that each list would contain. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number __gc[,] = new Double __gc[2,5];

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>In this case, the number variable is a two-dimensional array. In other words, the variable represents two lists. Each list contains 5 numbers. </p>
<p>To access a member of the array, type the name of the variable followed by the square brackets. Inside of the brackets, type the zero-based index of the desired list. The first list has an index of 0 while the second list has an index of 1. Then type the comma. On the right side of the comma, type the zero-based index of the member you want to access. Once you have accessed a member of the array, you can either assign it a value or retrieve the value it is currently holding. Here are examples: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number __gc[,] = new Double __gc[2,5];

    number[0,0] = 643.18;
    number[0,1] = 9.64;
    number[0,2] = -48.05;
    number[0,3] = 14.26;
    number[0,4] = 62.55;

    number[1,0] = 124.45;
    number[1,1] = -62.84;
    number[1,2] = 508.06;
    number[1,3] = 92.68;
    number[1,4] = -44.82;

    Console::WriteLine(S&quot;Value 1:  {0}&quot;, __box(number[0,0]));
    Console::WriteLine(S&quot;Value 2:  {0}&quot;, __box(number[0,1]));
    Console::WriteLine(S&quot;Value 3:  {0}&quot;, __box(number[0,2]));
    Console::WriteLine(S&quot;Value 4:  {0}&quot;, __box(number[0,3]));
    Console::WriteLine(S&quot;Value 5:  {0}&quot;, __box(number[0,4]));

    Console::WriteLine(S&quot;Value 6:  {0}&quot;, __box(number[1,0]));
    Console::WriteLine(S&quot;Value 7:  {0}&quot;, __box(number[1,1]));
    Console::WriteLine(S&quot;Value 8:  {0}&quot;, __box(number[1,2]));
    Console::WriteLine(S&quot;Value 9:  {0}&quot;, __box(number[1,3]));
    Console::WriteLine(S&quot;Value 10: {0}&quot;, __box(number[1,4]));

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>This would produce: </p>
<pre>Value 1:  643.18
Value 2:  9.64
Value 3:  -48.05
Value 4:  14.26
Value 5:  62.55
Value 6:  124.45
Value 7:  -62.84
Value 8:  508.06
Value 9:  92.68
Value 10: -44.82

Press any key to continue</pre>
<h2>Multi-Dimensional Arrays</h2>
<p>A multi-dimensional array is a list of a list of a list, etc. In other words, it is a list that contains other lists while these other lists may contain other lists. For example, a three-dimensional array is one that contains 3 lists; each of the 3 lists contains a certain number of lists; then each list inside contains a list of items. </p>
<p>To declare a multi-dimensional array, in the square brackets, type the number of comma minus the total number of lists. For example, the square brackets of a three-dimensional array would have 2 commas. The square brackets of a 5-dimensional array would have 4 commas. In the square brackets on the right side of the assignment operator must indicate the dimension of each level of list. Consider the following declaration: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double hoursWorked __gc[,,] = new Double[6,3,5];

    Console::WriteLine();
    return 0;
}</pre>
<p>In this declaration, the variable represents 6 lists. Each of the 6 lists is made of its own 3 lists. Each of the 3 lists contains 5 items. Another ways to illustrate this is that the array represents 6 months work for a contractor. In each of the six months, the contractor worked for 3 weeks. In each of the 3 weeks, the contractor worked for 5 days. </p>
<p>You can access each member of a multi-dimensional array using its index. In the above example, the first month has an index of 0 while the third month has an index of 2. Everything else is as done for the other dimensional arrays. </p>
<p>The String as an Array and Characters</p>
<h2>An Array of Characters</h2>
<p>In C/C++, you can declare a string variable as an array of characters. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    char School[] = &quot;American College of Computer &amp; Information Sciences&quot;;

    Console::Write(&quot;School Name: &quot;);
    Console::WriteLine(School);

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>This would produce: </p>
<pre>School Name: American College of Computer &amp; Information Sciences

Press any key to continue</pre>
<p>In various previous examples, we used the .NET&#8217;s <b>String</b> class to declare and process string variables. In some cases, you will need access to one character inside of a string. In C/C++, if you declare a string using an array of characters as done above, to access an individual character, you type the name of the variable followed by square brackets. Inside of the square brackets, you can type the 0-based index of the character you want to access. Remember that the C/C++ <b>char</b> data type is an 8-bit value (to access a character, you should use its <b>Char</b> or <b>__wchar_t</b> type). Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    char School[] = &quot;American College of Computer &amp; Information Sciences&quot;;
    Char First    = School[0];
    Char Second   = School[9];
    Char Third    = School[20];
    Char Fourth   = School[31];
    Char Fifth    = School[43];

    Console::Write(&quot;School Name: &quot;);
    Console::WriteLine(School);
    Console::WriteLine(S&quot;Abbreviation: {0}{1}{2}{3}{4}&quot;,
	              __box(First), __box(Second), __box(Third),
	              __box(Fourth), __box(Fifth));

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>This would produce: </p>
<pre>School Name: American College of Computer &amp; Information Sciences
Abbreviation: ACCIS

Press any key to continue</pre>
<p>The Characters of a String Class Value</p>
<p>Many libraries that feature a string class, such as the ATL&#8217;s <b>basic_string</b> class, the MFC&#8217;s <b>CString</b> class, or the VCL&#8217;s <b>AnsiString</b> class provide you the same mechanism (by overloading the [] operator). The Microsoft .NET Framework&#8217;s <b>String</b> class provides a different functionality. If you declare a String variable and want to access any of its characters, the String class provides a Chars property that uses square brackets to locate a character. This is done using the same approach as above except that you must call the Chars property. Here is an example of how this can be done: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    String* School = &quot;American College of Computer &amp; Information Sciences&quot;;
    Char First    = School-&gt;Chars[0];
    Char Second   = School-&gt;Chars[9];
    Char Third    = School-&gt;Chars[20];
    Char Fourth   = School-&gt;Chars[31];
    Char Fifth    = School-&gt;Chars[43];

    Console::Write(&quot;School Name: &quot;);
    Console::WriteLine(School);
    Console::WriteLine(S&quot;Abbreviation: {0}{1}{2}{3}{4}&quot;,
	              __box(First), __box(Second), __box(Third),
	              __box(Fourth), __box(Fifth));

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>It would produce the same result.</p>
<h2>Arrays and Functions</h2>
<h3>An Array as Argument</h3>
<p>An array can be passed to a function as argument. An array can also be returned by a function. To specify that a function takes an array as argument, declare the function as you would do for any regular function. In the parentheses of the function, declare the array with the __gc keyword as you have done so far. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

void ShowNumbers(double n __gc[]);

int _tmain()
{
    // TODO: Please replace the sample code below with your own.

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>When implementing the function, proceed as you would do normally. If you want to access the members of the array, use the same technique we have used so far, accessing each member of the array by its index. When you call the function from another function, simply pass the name of the array as argument. This would be done as follows:</p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

void ShowNumbers(double n __gc[]);

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    Double number[]= { 643.18, 9.64, 48.05, 14.26, 62.55 };

    ShowNumbers(number);

    Console::WriteLine(S&quot;&quot;);
    return 0;
}

void ShowNumbers(double Nbr __gc[])
{
    Console::WriteLine(S&quot;Value 1: {0}&quot;, __box(Nbr[0]));
    Console::WriteLine(S&quot;Value 2: {0}&quot;, __box(Nbr[1]));
    Console::WriteLine(S&quot;Value 3: {0}&quot;, __box(Nbr[2]));
    Console::WriteLine(S&quot;Value 4: {0}&quot;, __box(Nbr[3]));
    Console::WriteLine(S&quot;Value 5: {0}&quot;, __box(Nbr[4]));
}</pre>
<p>This would produce: </p>
<pre>Value 1: 643.18
Value 2: 9.64
Value 3: 48.05
Value 4: 14.26
Value 5: 62.55

Press any key to continue</pre>
<p>If you create a function that takes a non-managed array as argument, you usually would pass an additional argument that carries the size of the array. On the other hand, if you create a function that takes a managed array as argument, since the array would inherit from the Array class, the argument would automatically carry its dimension from the Length property of the Array class. Therefore, with a managed array as argument, you don&#8217;t have to specify the number of members to the function; the compiler would figure that out. </p>
<h3>Returning an Array</h3>
<p>Whether in C/C++ or Managed C++, an array is (always) passed as a reference. Although in C/C++, there is no formal way to return an array from a function, because an array is passed as a reference, it is very easy to return an array. Actually, this technique is used in C++ as an accessory, not as a means. Managed C++ formal features the idea of returning an array from a function. Although this is a new feature not available in C/C++, it is very easy to use, so easy that there is very little effort to implement this valuable addition. </p>
<p>To indicate that a function would return an array, if you are only declaring the function, type empty square brackets between the function&#8217;s parentheses and its semi-colon. Here is an example: </p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

Double GetNumbers()[];

void ShowNumbers(double n __gc[]);

int _tmain()
{
    // TODO: Please replace the sample code below with your own.

    Console::WriteLine(S&quot;&quot;);
    return 0;
}</pre>
<p>When defining the function, type the square brackets between the function&#8217;s parentheses and its opening curly bracket. In the body of the function, you can declare an array, do what you want with it, and then return it as the return value of the function.</p>
<p>When calling a function that returns an array, proceed with the rules you would use for any other function. For example, you can call the function in another and use it as you see fit. You can also assign the function to an array variable in order to initialize the variable. Here is an example:</p>
<pre>// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include &quot;stdafx.h&quot;

#using &lt;mscorlib.dll&gt;

using namespace System;

Double GetNumbers()[];

void ShowNumbers(double n __gc[]);

int _tmain()
{
    // TODO: Please replace the sample code below with your own.
    <b>Double no __gc[] = GetNumbers();</b>
    ShowNumbers(no);

    Console::WriteLine(S&quot;&quot;);
    return 0;
}

Double GetNumbers()<b>[]</b>
{
    Double number[] = { 643.18, 9.64, 48.05, 14.26, 62.55 };

    return number;
}

void ShowNumbers(double Nbr __gc[])
{
    Console::WriteLine(S&quot;Value 1: {0}&quot;, __box(Nbr[0]));
    Console::WriteLine(S&quot;Value 2: {0}&quot;, __box(Nbr[1]));
    Console::WriteLine(S&quot;Value 3: {0}&quot;, __box(Nbr[2]));
    Console::WriteLine(S&quot;Value 4: {0}&quot;, __box(Nbr[3]));
    Console::WriteLine(S&quot;Value 5: {0}&quot;, __box(Nbr[4]));
}</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arrays in C#</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 13:57:49 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Arrays of Arrays]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Jagged Arrays]]></category>
		<category><![CDATA[Multidimensional Arrays]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/</guid>
		<description><![CDATA[This tutorial describes arrays and how they work in C#.
Tutorial
This tutorial is divided into the following sections: 

Arrays in General 
Declaring Arrays 
Initializing Arrays 
Accessing Array Members 
Arrays are Objects 
Using foreach with Arrays

 
Arrays in General
C# arrays are zero indexed; that is, the array indexes start at zero. Arrays in C# work similarly to [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial describes arrays and how they work in C#.</p>
<h2>Tutorial</h2>
<p>This tutorial is divided into the following sections: </p>
<ul>
<li>Arrays in General </li>
<li>Declaring Arrays </li>
<li>Initializing Arrays </li>
<li>Accessing Array Members </li>
<li>Arrays are Objects </li>
<li>Using foreach with Arrays</li>
</ul>
<p> <span id="more-187"></span><br />
<h2>Arrays in General</h2>
<p>C# arrays are zero indexed; that is, the array indexes start at zero. Arrays in C# work similarly to how arrays work in most other popular languages There are, however, a few differences that you should be aware of.</p>
<p>When declaring an array, the square brackets ([]) must come after the type, not the identifier. Placing the brackets after the identifier is not legal syntax in C#.</p>
<pre>int[] table; // not int table[];  </pre>
<p>Another detail is that the size of the array is not part of its type as it is in the C language. This allows you to declare an array and assign any array of <b>int</b> objects to it, regardless of the array&#8217;s length.</p>
<pre>int[] numbers; // declare numbers as an int array of any size
numbers = new int[10];  // numbers is a 10-element array
numbers = new int[20];  // now it's a 20-element array</pre>
<h5>Declaring Arrays</h5>
<p>C# supports single-dimensional arrays, multidimensional arrays (rectangular arrays), and array-of-arrays (jagged arrays). The following examples show how to declare different kinds of arrays:</p>
<p>Single-dimensional arrays:</p>
<pre>int[] numbers;</pre>
<p>Multidimensional arrays:</p>
<pre>string[,] names;</pre>
<p>Array-of-arrays (jagged):</p>
<pre>byte[][] scores;</pre>
<p>Declaring them (as shown above) does not actually create the arrays. In C#, arrays are objects (discussed later in this tutorial) and must be instantiated. The following examples show how to create arrays:</p>
<p>Single-dimensional arrays:</p>
<pre>int[] numbers = new int[5];</pre>
<p>Multidimensional arrays:</p>
<pre>string[,] names = new string[5,4];</pre>
<p>Array-of-arrays (jagged):</p>
<pre>byte[][] scores = new byte[5][];
for (int x = 0; x &lt; scores.Length; x++)
{
   scores[x] = new byte[4];
}</pre>
<p>You can also have larger arrays. For example, you can have a three-dimensional rectangular array:</p>
<pre>int[,,] buttons = new int[4,5,3];</pre>
<p>You can even mix rectangular and jagged arrays. For example, the following code declares a single-dimensional array of three-dimensional arrays of two-dimensional arrays of type <b>int</b>:</p>
<pre>int[][,,][,] numbers;</pre>
<h4>Example</h4>
<p>The following is a complete C# program that declares and instantiates arrays as discussed above.</p>
<pre>// arrays.cs
using System;
class DeclareArraysSample
{
    public static void Main()
    {
        // Single-dimensional array
        int[] numbers = new int[5];

        // Multidimensional array
        string[,] names = new string[5,4];

        // Array-of-arrays (jagged array)
        byte[][] scores = new byte[5][];

        // Create the jagged array
        for (int i = 0; i &lt; scores.Length; i++)
        {
            scores[i] = new byte[i+3];
        }

        // Print length of each row
        for (int i = 0; i &lt; scores.Length; i++)
        {
            Console.WriteLine(&quot;Length of row {0} is {1}&quot;, i, scores[i].Length);
        }
    }
}</pre>
<h4>Output</h4>
<pre>Length of row 0 is 3
Length of row 1 is 4
Length of row 2 is 5
Length of row 3 is 6
Length of row 4 is 7</pre>
<h2>Initializing Arrays</h2>
<p>C# provides simple and straightforward ways to initialize arrays at declaration time by enclosing the initial values in curly braces ({}). The following examples show different ways to initialize different kinds of arrays.</p>
<blockquote><p><b>Note&#160;&#160; </b>If you do not initialize an array at the time of declaration, the array members are automatically initialized to the default initial value for the array type. Also, if you declare the array as a field of a type, it will be set to the default value null when you instantiate the type.</p></blockquote>
<h3>Single-Dimensional Array</h3>
<pre>int[] numbers = new int[5] {1, 2, 3, 4, 5};
string[] names = new string[3] {&quot;Matt&quot;, &quot;Joanne&quot;, &quot;Robert&quot;};</pre>
<p>You can omit the size of the array, like this:</p>
<pre>int[] numbers = new int[] {1, 2, 3, 4, 5};
string[] names = new string[] {&quot;Matt&quot;, &quot;Joanne&quot;, &quot;Robert&quot;};</pre>
<p>You can also omit the <b>new</b><i></i>operator if an initializer is provided, like this:</p>
<pre>int[] numbers = {1, 2, 3, 4, 5};
string[] names = {&quot;Matt&quot;, &quot;Joanne&quot;, &quot;Robert&quot;};</pre>
<h3>Multidimensional Array</h3>
<pre>int[,] numbers = new int[3, 2] { {1, 2}, {3, 4}, {5, 6} };
string[,] siblings = new string[2, 2] { {&quot;Mike&quot;,&quot;Amy&quot;}, {&quot;Mary&quot;,&quot;Albert&quot;} };</pre>
<p>You can omit the size of the array, like this:</p>
<pre>int[,] numbers = new int[,] { {1, 2}, {3, 4}, {5, 6} };
string[,] siblings = new string[,] { {&quot;Mike&quot;,&quot;Amy&quot;}, {&quot;Mary&quot;,&quot;Albert&quot;} };</pre>
<p>You can also omit the <b>new</b><i></i>operator if an initializer is provided, like this:</p>
<pre>int[,] numbers = { {1, 2}, {3, 4}, {5, 6} };
string[,] siblings = { {&quot;Mike&quot;, &quot;Amy&quot;}, {&quot;Mary&quot;, &quot;Albert&quot;} };</pre>
<h3>Jagged Array (Array-of-Arrays)</h3>
<p>You can initialize jagged arrays like this example:</p>
<pre>int[][] numbers = new int[2][] { new int[] {2,3,4}, new int[] {5,6,7,8,9} };</pre>
<p>You can also omit the size of the first array, like this:</p>
<pre>int[][] numbers = new int[][] { new int[] {2,3,4}, new int[] {5,6,7,8,9} };</pre>
<p>-or-</p>
<pre>int[][] numbers = { new int[] {2,3,4}, new int[] {5,6,7,8,9} };</pre>
<p>Notice that there is no initialization syntax for the elements of a jagged array. </p>
<h2>Accessing Array Members</h2>
<p>Accessing array members is straightforward and similar to how you access array members in C/C++. For example, the following code creates an array called <code>numbers</code> and then assigns a <code>5</code> to the fifth element of the array:</p>
<pre>int[] numbers = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
numbers[4] = 5;</pre>
<p>The following code declares a multidimensional array and assigns <code>5</code> to the member located at <code>[1, 1]</code>:</p>
<pre>int[,] numbers = { {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10} };
numbers[1, 1] = 5;</pre>
<p>The following is a declaration of a single-dimension jagged array that contains two elements. The first element is an array of two integers, and the second is an array of three integers:</p>
<pre>int[][] numbers = new int[][] { new int[] {1, 2}, new int[] {3, 4, 5}
};</pre>
<p>The following statements assign 58 to the first element of the first array and 667 to the second element of the second array:</p>
<pre>numbers[0][0] = 58;
numbers[1][1] = 667;</pre>
<h2>Arrays are Objects</h2>
<p>In C#, arrays are actually objects. <b>System.Array</b> is the abstract base type of all array types. You can use the properties, and other class members, that <b>System.Array</b> has. An example of this would be using the Length<b></b>property to get the length of an array. The following code assigns the length of the <code>numbers</code> array, which is <code>5</code>, to a variable called <code>LengthOfNumbers</code>:</p>
<pre>int[] numbers = {1, 2, 3, 4, 5};
int LengthOfNumbers = numbers.Length;</pre>
<p>The <b>System.Array</b> class provides many other useful methods/properties, such as methods for sorting, searching, and copying arrays.</p>
<h2>Using foreach on Arrays</h2>
<p>C# also provides the <b>foreach</b> statement. This statement provides a simple, clean way to iterate through the elements of an array. For example, the following code creates an array called <code>numbers</code> and iterates through it with the <b>foreach</b> statement:</p>
<pre>int[] numbers = {4, 5, 6, 1, 2, 3, -2, -1, 0};
foreach (int i in numbers)
{
   System.Console.WriteLine(i);
}</pre>
<p>With multidimensional arrays, you can use the same method to iterate through the elements, for example:</p>
<pre>int[,] numbers = new int[3, 2] {{9, 99}, {3, 33}, {5, 55}};
foreach(int i in numbers)
{
   Console.Write(&quot;{0} &quot;, i);
}</pre>
<p>The output of this example is:</p>
<pre>9 99 3 33 5 55</pre>
<p>However, with multidimensional arrays, using a nested <b>for</b> loop gives you more control over the array elements.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/25/arrays-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Ribbon Control with Windows Forms: What I Learnt Today?</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 17:11:52 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[WILT]]></category>
		<category><![CDATA[Windows Forms]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[Ribbon control]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/</guid>
		<description><![CDATA[Recently I have been exploring the use of Ribbon Control. Yesterday, I posted a tutorial on its use with Windows Workflow Foundation. However, I am far more comfortable developing applications with Windows Forms compared to WPF. So, I searched for Ribbon Control for Windows Forms. Although I found an open source version here, there was [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Recently I have been exploring the use of <a href="http://msdn.microsoft.com/en-us/library/cc872782.aspx" target="_blank">Ribbon Control</a>. Yesterday, I posted <a href="http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/" target="_blank">a tutorial</a> on its use with Windows Workflow Foundation. However, I am far more comfortable developing applications with Windows Forms compared to WPF. So, I searched for Ribbon Control for Windows Forms. Although I found an open source version <a href="http://ribbon.codeplex.com" target="_blank">here</a>, there was no associated tutorial. So I decided to write one. In this tutorial I will explain how to create a simple windows forms application with a Ribbon Control and how to add buttons. </p>
<p align="justify">If you need the basic concepts about Ribbon Control, read the first part of my <a href="http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/" target="_blank">previous post</a>.</p>
<div align="justify"><span id="more-186"></span></div>
<p align="justify">1. Download the Ribbon Control binaries <a href="http://ribbon.codeplex.com/" target="_blank">here</a>.</p>
<p align="justify">2. Create a Windows Forms Visual Studio Project.</p>
<p align="justify">3. Add reference to the downloaded System.Windows.Forms.Ribbon.dll</p>
<p align="justify">4. Declare a System.Windows.Forms.Ribbon reference in Designer.cs file of your form and create an object (you also need to add some more supporting code). Be sure to include System.Windows.Forms to your code. Your .Designer.cs file should look somewhat like this;</p>
<div align="justify">
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> System.Windows.Forms;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> DMProject</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">partial</span> <span style="color: #0000ff">class</span> Form1</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// Required designer variable.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">private</span> System.ComponentModel.IContainer components = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">private</span> System.Windows.Forms.Ribbon ribbon1 = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// Clean up any resources being used.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;param name=&quot;disposing&quot;&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> Dispose(<span style="color: #0000ff">bool</span> disposing)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">if</span> (disposing &amp;&amp; (components != <span style="color: #0000ff">null</span>))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                components.Dispose();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">base</span>.Dispose(disposing);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #cc6633">#region</span> Windows Form Designer generated code</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// Required method for Designer support - do not modify</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// the contents of this method with the code editor.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> InitializeComponent()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.ribbon1 = <span style="color: #0000ff">new</span> System.Windows.Forms.Ribbon();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.SuspendLayout();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// ribbon1</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// Form1</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.AutoScaleDimensions = <span style="color: #0000ff">new</span> System.Drawing.SizeF(6F, 13F);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.ClientSize = <span style="color: #0000ff">new</span> System.Drawing.Size(284, 262);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.Controls.Add(<span style="color: #0000ff">this</span>.ribbon1);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.Name = <span style="color: #006080">&quot;Form1&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.Text = <span style="color: #006080">&quot;Form1&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">this</span>.ResumeLayout(<span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></div>
</p></div>
</div>
<p align="justify">
<p align="justify">Your Windows Form Should look like this;</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image9.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb8.png" width="304" height="304" /></a> </p>
<p align="justify">From this point onward, adding controls to the ribbon should be easy.</p>
<p align="justify">5. To add a tab to your ribbon control, click ‘Add Tab’. I have added three tabs; Home, Data Manipulation and Visualization. As with any control, you can change the properties of the tabs using the properties grid.</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image10.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb9.png" width="504" height="285" /></a> </p>
<p align="justify">You can now compile and run the application, it would look like the screenshot above.</p>
<p align="justify">6. The next step is to add a panel to contain the buttons. To do this, click the ‘Add Panel’ button. Change the properties of the panels as desired.</p>
<p align="justify">7. Once the panels have been created, click a panel. The property grid shows options for the panel. Besides ‘Add Button’, these options include ‘Add Button List’, ‘Add Item Group’, ‘Add Separator’ etc. Click the ‘Add Button’ command. A button is created. You can use the property grid to set the text, tool tip and image for the button.</p>
<p align="justify">To add images to these buttons, you first have add the PNG images to your project resources. To do this, right click on your project and click Properties. In the resources tab, select ‘Add Existing File’ and browse for your PNG icons.</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image11.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb10.png" width="504" height="316" /></a> </p>
<p align="justify">Congratulations! you have successfully added a ribbon control to your Windows Forms Application. You are good to go!</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image12.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb11.png" width="404" height="229" /></a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/19/using-ribbon-control-with-windows-forms-what-i-learnt-today/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Create A Simple WPF Ribbon Control: What I learnt Today?</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 17:45:51 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WILT]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[Ribbon control]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>
		<category><![CDATA[What I Learnt Today?]]></category>
		<category><![CDATA[Windows Presentation Foundation]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/</guid>
		<description><![CDATA[In this tutorial I would explain how to create a simple Ribbon Control using Windows Presentation Foundation. 
 
Image Courtesy MSDN.

The WPF team is sharing new WPF Ribbon control starting on Monday, October 27, 2008! Binaries and source code for the Ribbon can be downloaded at the Office UI Licensing site.
So, your first step is [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">In this tutorial I would explain how to create a simple <a href="http://msdn.microsoft.com/en-us/library/cc872782.aspx" target="_blank">Ribbon Control</a> using <a href="http://msdn.microsoft.com/en-us/library/ms754130.aspx" target="_blank">Windows Presentation Foundation</a>. </p>
<p align="justify"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image.png" width="504" height="209" /> </p>
<p align="justify"><em><strong>Image Courtesy MSDN.</strong></em></p>
<div align="justify"><span id="more-171"></span></div>
<p align="justify">The WPF team is sharing new WPF Ribbon control starting on Monday, October 27, 2008! Binaries and source code for the Ribbon can be downloaded at the Office UI Licensing site.</p>
<p align="justify">So, your first step is to go to Office UI Licensing site and get yourself a free WPF ribbon control. You must accept and sign license (it’s not a big deal) and download free WPF ribbon control. <strong><a href="http://msdn.microsoft.com/hr-hr/office/aa973809%28en-us%29.aspx">Just follow this link</a>.</strong></p>
<h2 align="justify">What is Ribbon Control?</h2>
<p align="justify">Ribbons are the modern way to help users find, understand, and use commands efficiently and directly—with a minimum number of clicks, with less need to resort to trial-and-error, and without having to refer to Help.</p>
<p align="justify">The preview version of the WPF Ribbon includes many of the features which Independent Software Vendors (ISVs) need to add a Ribbon control to their WPF applications. Ribbon is a command bar that organizes a program&#8217;s features into a series of tabs at the top of a window. The Ribbon UI was designed by Microsoft Office to increase discoverability of features and functions, enable quicker learning of the program as a whole, and make users feel more in control of their experience with the program. The Ribbon is designed to replace the traditional menu bar and toolbars. The WPF Ribbon will include all of the basic Ribbon features and functionality, including tabs, groups, controls (buttons, split buttons, galleries, etc.), title bar integration of the application menu button and quick access toolbar, and resizing with dynamic layout.</p>
<p align="justify">For more information, follow <a href="http://msdn.microsoft.com/en-us/library/cc872782.aspx" target="_blank">this link</a>.</p>
<p align="justify">&#160;</p>
<h2 align="justify">Step 1: Adding The Ribbon Control to your WPF Application</h2>
<p align="justify">1. Create a new WPF Project using Visual Studio .NET 2008.</p>
<p align="justify">2. Add a reference to “RibbonControlsLibrary.dll” that you downloaded earlier.</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb.png" width="504" height="316" /></a> </p>
<p align="justify">3. Add the XAML Reference to the DLL you have just added to your project by adding this line to your XAML code.</p>
<p align="justify">xmlns:r=&quot;clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary&quot;</p>
<p align="justify">4. Change the root element of your XAML code to r:RibbonWindow instead of Window. </p>
<div align="justify">
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;FirstRibbonApplication.Window1&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #ff0000">xmlns:r</span><span style="color: #0000ff">=&quot;clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;300&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;300&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</p></div>
</div>
<p align="justify">5. Add the r:Ribbon tag to your XAML code.</p>
<div align="justify">
<pre>&lt;r:Ribbon Title=&quot;WPF Ribbon - Document1&quot; x:Name=&quot;ribbon&quot; /&gt;</pre>
</div>
<p align="justify">Your XAML code should now look like this;</p>
<div align="justify">
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;FirstRibbonApplication.Window1&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:r</span><span style="color: #0000ff">=&quot;clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;300&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;300&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:Ribbon</span> <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;WPF Ribbon - Document1&quot;</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;ribbon&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</p></div>
</div>
<p align="justify">Congratulations! you have successfully added a ribbon control to your WPF application. Before you can see the control you would need to make a few changes to the accompanying cs file. Open the cs and add the following library and make sure that the partial class inherits from RibbonWindow instead of Window.</p>
<div align="justify">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Microsoft.Windows.Controls.Ribbon;</pre>
<p><!--CRLF--></div>
</div>
<p align="justify">
<p align="justify">Compile and run the application to see the results.</p>
<p align="justify"><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb1.png" width="504" height="412" /></a> </p>
<h2>Step 2: Adding Tabs, Groups and Buttons</h2>
<p align="justify">As described earlier a ribbon control contains different tabs, each tab contains a groups and groups in turn contain buttons. In this step we would create tabs, groups and buttons.</p>
<p align="justify">1. To add tabs to your ribbon control add the r:RibbonTab tag within the r:Ribbon tag you added in the last step.</p>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Home&quot;</span><span style="color: #0000ff">&gt;</span>

<span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Insert&quot;</span><span style="color: #0000ff">&gt;</span>

<span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Help&quot;</span><span style="color: #0000ff">&gt;</span>

<span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>Your application should look somewhat like this now. Note that the support for hovering and clicking has been added automatically.</div>
<div><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb2.png" width="504" height="475" /></a>&#160; </div>
<div>2. To add groups within a tab, place the r:RibbonGroup tag inside the r:RibbonTab tag.</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Fonts&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>I am adding Clipboard and Fonts tabs within the Home tab. </div>
<div><strong>Note: If you run the application containing empty Ribbon Groups it would crash.</strong></div>
<div>3. Now to add buttons, place the r:RibbonButton tags inside the r:RibbonGroup tags you just created.</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span> <span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>Your code should not look like this;</div>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;FirstRibbonApplication.Window1&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:r</span><span style="color: #0000ff">=&quot;clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;300&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;300&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:Ribbon</span> <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;ribbon&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Home&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span> <span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Fonts&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span> <span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Insert&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Help&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:Ribbon</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<div>Congratulations! You have successfully created tabs, groups and buttons in your ribbon control application.</div>
<div><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb3.png" width="504" height="402" /></a> </div>
<div>Note that the buttons are still blank. We will take care of this in Step 3.</div>
<h2>Step 3: Adding Commands to Ribbon Groups and Ribbon Buttons</h2>
<div>In this step we would define resources for our ribbon groups and ribbon buttons and define commands on them.</div>
<div>1. Create an Images folder and add some images to act as icons for your ribbon buttons. </div>
<div>2. Use the following XAML code to define a resource dictionay within the RibbonWindow tag. We would use this to define resources for our buttons.</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow.Resources</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow.Resources</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>3. Now add a resource for our Clipboard Ribbon Group. The code would look like this.</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonCommand</span> <span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;ClipboardGroupCommand&quot;</span><span style="color: #ff0000">CanExecute</span><span style="color: #0000ff">=&quot;OnCanExecute&quot;</span><span style="color: #ff0000">Executed</span><span style="color: #0000ff">=&quot;OnShowClipboardGroup&quot;</span><span style="color: #ff0000">LabelTitle</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
</div>
<div><strong>x:Key</strong> is used to reference this element. </div>
<div><strong>CanExecute</strong> and <strong>Execute</strong> are holding names for events that would be fired. </div>
<div><strong>LabelTitle</strong> holds the title of the group we are creating this resource for.</div>
<div>4. Once the resource has been defined, let us use it for the Clipboard group. </div>
<div>Find this part in your XAML code;</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>and replace it with </div>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span> <span style="color: #ff0000">HasDialogLauncher</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{StaticResource ClipboardGroupCommand}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<p>Now, we have connected our resource with RibbonGroup. I have added HasDialogLauncher=”True” because that will allow us to fire OnShowClipboardGroup&#160; event when user clicks on dialog launcher.</p>
</p>
</p>
</p>
</p>
</p>
<p>5. Go to your CS code-behind file and add these lines:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> OnCanExecute(<span style="color: #0000ff">object</span> target, CanExecuteRoutedEventArgs args){args.CanExecute = <span style="color: #0000ff">true</span>;}

<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> OnShowClipboardGroup(<span style="color: #0000ff">object</span> target, ExecutedRoutedEventArgs args){MessageBox.Show(<span style="color: #006080">&quot;This is the Clipboard!.&quot;</span>, <span style="color: #006080">&quot;Clipboard Dialog&quot;</span>);}</pre>
<p></div>
</p>
<p>In principal we are done with this step and the essential concepts have been learnt. You can now learn your application and test to see that the message box is displayed.</p>
<p><a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image7.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb6.png" width="504" height="404" /></a> </p>
</p>
<p>Similar to step 4 and 5 create another RibbonCommand, add the resource to the Copy Button and write the corresponding cs code.</p>
<p>Creating another RibbonCommand;</p>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonCommand</span><span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;CopyCommand&quot;</span><span style="color: #ff0000">CanExecute</span><span style="color: #0000ff">=&quot;OnCanExecute&quot;</span><span style="color: #ff0000">Executed</span><span style="color: #0000ff">=&quot;OnCopyCommand&quot;</span><span style="color: #ff0000">LabelTitle</span><span style="color: #0000ff">=&quot;Copy&quot;</span><span style="color: #ff0000">LargeImageSource</span><span style="color: #0000ff">=&quot;Images\copy.png&quot;</span><span style="color: #ff0000">ToolTipTitle</span><span style="color: #0000ff">=&quot;Copy (Ctrl+C)&quot;</span><span style="color: #ff0000">ToolTipDescription</span><span style="color: #0000ff">=&quot;Copies the selected content on to the clipboard&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonCommand</span><span style="color: #0000ff">&gt;</span></pre>
<p>Adding the RibbonCommand to the RibbonButton;</p></div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Copy&quot;</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{StaticResource CopyCommand}&quot;</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
</div>
<div>Adding the event to the code-beside file;</div>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> OnCopyCommand(<span style="color: #0000ff">object</span> target, ExecutedRoutedEventArgs args){    MessageBox.Show(<span style="color: #006080">&quot;This is the copy button!.&quot;</span>, <span style="color: #006080">&quot;Copy Dialog&quot;</span>);}</pre>
</div>
<div>Your XAML code should look like this now;</div>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;FirstRibbonApplication.Window1&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">xmlns:r</span><span style="color: #0000ff">=&quot;clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;600&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;400&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonWindow.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonCommand</span> <span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;ClipboardGroupCommand&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                             <span style="color: #ff0000">CanExecute</span><span style="color: #0000ff">=&quot;OnCanExecute&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                             <span style="color: #ff0000">Executed</span><span style="color: #0000ff">=&quot;OnShowClipboardGroup&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                             <span style="color: #ff0000">LabelTitle</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonCommand</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonCommand</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;CopyCommand&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">CanExecute</span><span style="color: #0000ff">=&quot;OnCanExecute&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">Executed</span><span style="color: #0000ff">=&quot;OnCopyCommand&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">LabelTitle</span><span style="color: #0000ff">=&quot;Copy&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">LargeImageSource</span><span style="color: #0000ff">=&quot;Images\copy.png&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">ToolTipTitle</span><span style="color: #0000ff">=&quot;Copy (Ctrl+C)&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #ff0000">ToolTipDescription</span><span style="color: #0000ff">=&quot;Copies the selected content on to the clipboard&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonCommand</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span>  <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Stretch&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:Ribbon</span> <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;Window1&quot;</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;ribbon&quot;</span>  <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Home&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Clipboard&quot;</span> <span style="color: #ff0000">HasDialogLauncher</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{StaticResource ClipboardGroupCommand}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Copy&quot;</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{StaticResource CopyCommand}&quot;</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonGroup</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Fonts&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonButton</span>  <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;Paste&quot;</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">r:RibbonButton</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonGroup</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Insert&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">r:RibbonTab</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">=&quot;Help&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonTab</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:Ribbon</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">r:RibbonWindow</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<div>Now you should be able to see an icon on your Copy Button and an accompanying tooltip.</div>
<div>&#160;<a href="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image8.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tayyab.xenoglaux-solutions.com/wp-content/uploads/2010/04/image_thumb7.png" width="504" height="404" /></a> </p>
<p></div>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/18/create-a-simple-wpf-ribbon-control-what-i-learnt-today/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What I learnt Today?</title>
		<link>http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/</link>
		<comments>http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 15:54:23 +0000</pubDate>
		<dc:creator>tayyabtariq</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[WILT]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[Ribbon control]]></category>
		<category><![CDATA[What I Learnt Today?]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/</guid>
		<description><![CDATA[Hello Everyone,
To end the inactive blogging period, I have decided to start a new series of posts on my blog. Each one of these posts would describe something new I learnt during the day. I have chosen to name it “What I Learnt Today?”
Shortly, I would post a tutorial on creating Ribbon Control using Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Everyone,</p>
<p>To end the inactive blogging period, I have decided to start a new series of posts on my blog. Each one of these posts would describe something new I learnt during the day. I have chosen to name it “What I Learnt Today?”</p>
<p>Shortly, I would post a tutorial on creating <a href="http://msdn.microsoft.com/en-us/library/cc872782.aspx" target="_blank">Ribbon Control</a> using <a href="http://msdn.microsoft.com/en-us/library/ms754130.aspx" target="_blank">Windows Presentation Foundation</a>.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/" target="_blank"><img src="http://tayyab.xenoglaux-solutions.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://tayyab.xenoglaux-solutions.com/2010/04/18/what-i-learnt-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
