<?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>Code For Future &#187; Winforms</title>
	<atom:link href="http://codeforfuture.com/category/winforms/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeforfuture.com</link>
	<description>Share as you code.</description>
	<lastBuildDate>Sun, 18 Jul 2010 05:30:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Solution: Changing color of disabled checkbox or radioButton</title>
		<link>http://codeforfuture.com/2008/12/24/solution-changing-color-of-disabled-checkbox-or-radiobutton/</link>
		<comments>http://codeforfuture.com/2008/12/24/solution-changing-color-of-disabled-checkbox-or-radiobutton/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 10:21:00 +0000</pubDate>
		<dc:creator>Jayvardhan Patil</dc:creator>
				<category><![CDATA[MS.NET]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://codeforfuture.com/2008/12/24/solution-changing-color-of-disabled-checkbox-or-radiobutton/</guid>
		<description><![CDATA[Applies to: C#.NET/VB.NET (Windows Programming).
1. Making it gray
After being disabled, the checkbox and radiobutton control&#8217;s ForeColor turns contrast to the BackColor of the form.This behavior is good because it increases the readability of your forms.
But in some cases this is really not desired.
So in that case you can make the CheckBox/RadioButton gray by setting its









BackColor [...]]]></description>
			<content:encoded><![CDATA[<p>Applies to: C#.NET/VB.NET (Windows Programming).</p>
<p><span style="font-weight: bold;">1. Making it gray</span></p>
<p>After being disabled, the checkbox and radiobutton control&#8217;s ForeColor turns contrast to the BackColor of the form.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xm5KTL2VzWo/SVINx7QGSaI/AAAAAAAABC4/_yl97pppj-g/s1600-h/checkbox+blue.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 115px; height: 27px;" src="http://2.bp.blogspot.com/_xm5KTL2VzWo/SVINx7QGSaI/AAAAAAAABC4/_yl97pppj-g/s400/checkbox+blue.jpg" alt="" id="BLOGGER_PHOTO_ID_5283300464228977058" border="0" /></a>This behavior is good because it increases the readability of your forms.</p>
<p>But in some cases this is really not desired.</p>
<p>So in that case you can make the CheckBox/RadioButton gray by setting its</p>
<p><span style="font-style: italic; color: rgb(0, 0, 0);font-family:courier new;" >BackColor = Color.Transparent</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xm5KTL2VzWo/SVINyOoH04I/AAAAAAAABDI/n_gJmqLqdfY/s1600-h/properties.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 254px; height: 65px;" src="http://4.bp.blogspot.com/_xm5KTL2VzWo/SVINyOoH04I/AAAAAAAABDI/n_gJmqLqdfY/s400/properties.jpg" alt="" id="BLOGGER_PHOTO_ID_5283300469430014850" border="0" /></a>This will give you desired output.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xm5KTL2VzWo/SVINyJshfCI/AAAAAAAABDA/j3npmE8BK-8/s1600-h/checkbox+grey.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 112px; height: 31px;" src="http://2.bp.blogspot.com/_xm5KTL2VzWo/SVINyJshfCI/AAAAAAAABDA/j3npmE8BK-8/s400/checkbox+grey.jpg" alt="" id="BLOGGER_PHOTO_ID_5283300468106296354" border="0" /></a><br /><span style="font-weight: bold;">2. Changing the ForeColor</span></p>
<p>Sorry I do not have anything to offer you on the front.</p>
<p>There is a private property to the control class which seems to be deciding the disable backcolor of the Checkbox/radioButton.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xm5KTL2VzWo/SVIP9pp2fuI/AAAAAAAABDY/0YOkfn-lPLg/s1600-h/disabledcolor.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 11px;" src="http://1.bp.blogspot.com/_xm5KTL2VzWo/SVIP9pp2fuI/AAAAAAAABDY/0YOkfn-lPLg/s400/disabledcolor.jpg" alt="" id="BLOGGER_PHOTO_ID_5283302864686841570" border="0" /></a></p>
<p>If anyone has any idea about this let me know.<br />
<br/><br />
<span style="font-weight:bold;"><br />
If you found this post helpful then please share it.<br />
</span></p>
<p><a href="http://hub.tm/?NdYJN"><br />
<img border="0" target="_new" src="http://twitter.grader.com/assets/img/tweet-it-button.jpg" alt="TweetIt from HubSpot" title=""/><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codeforfuture.com/2008/12/24/solution-changing-color-of-disabled-checkbox-or-radiobutton/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
