<?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>Gorancic.com &#187; Controls</title>
	<atom:link href="http://www.gorancic.com/blog/tag/controls/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gorancic.com/blog</link>
	<description>Gorancic.com Blog</description>
	<lastBuildDate>Sun, 22 Jan 2012 10:49:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Removing white border on a ToolStrip</title>
		<link>http://www.gorancic.com/blog/net/removing-white-border-in-a-toolstrip</link>
		<comments>http://www.gorancic.com/blog/net/removing-white-border-in-a-toolstrip#comments</comments>
		<pubDate>Sun, 08 Mar 2009 02:30:59 +0000</pubDate>
		<dc:creator>Beno Gorancic</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[ToolStrip]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.gorancic.com/blog/?p=59</guid>
		<description><![CDATA[If you have ever used the ToolStrip control and changed its background colour, you will have noticed that it has a white border around it as show in the picture. This problem can be overcome with a simple override. Create a new file ToolStripOverride.cs and copy the following code. 1 2 3 4 5 6 [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://www.gorancic.com/blog/wp-content/uploads/toolstripline.gif" title="ToolStrip bug" class="alignright" width="169" height="120" />If you have ever used the ToolStrip control and changed its background colour, you will have noticed that it has a white border around it as show in the picture. This problem can be overcome with a simple override.</p>
<p>Create a new file ToolStripOverride.cs and copy the following code.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Windows.Forms</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> OverrideControls
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ToolStripOverride <span style="color: #008000;">:</span> ToolStripProfessionalRenderer
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> ToolStripOverride<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnRenderToolStripBorder<span style="color: #008000;">&#40;</span>ToolStripRenderEventArgs e<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Then inside the class where you have your ToolStrip control add the following line to the constructor.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">myToolStripControl<span style="color: #008000;">.</span><span style="color: #0000FF;">Renderer</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ToolStripOverride<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gorancic.com/blog/net/removing-white-border-in-a-toolstrip/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

