Pasan Ratnayake
posted
58 posts
since
Apr 06, 2009
from
Sri Lanka
|
|
Re: Problem with changing Radiobutton Color
|
|
|
|
|
|
|
|
|
|
|
Hey...
Shouldn't you be abit more specific? At the very least state whether it's a Windows form control or Web control and of what do you need to change the color (i.e. the color of the check or the color of the background of the checkbox or the border color of the checkbox).
|
|
|
|
|
|
Majid Kamali
posted
166 posts
since
Jul 13, 2010
from
Iran, Tehran
|
|
Re: Problem with changing Radiobutton Color
|
|
|
|
|
|
|
|
|
|
|
It's a windows form control. I want to change check color.
|
|
|
|
|
|
Pasan Ratnayake
posted
58 posts
since
Apr 06, 2009
from
Sri Lanka
|
|
Re: Problem with changing Radiobutton Color
|
|
|
|
|
|
|
|
|
|
|
Oh... Have you programmed any custom controls? All you have to do is create a custom user control and derive it from "CheckBox" class instead of the "UserControl" class. After that you have to override the default behavior in the Paint event.
I have done a simple overriding in the code attached herewith. If you want a check with a different color, all you have to create an image of a check with a different color using a image processing tool and draw it. I've included a comment where you want to write that coding.
To use the class library that I have uploaded here, create a blank solution and this class library to that. Add another windows form project to the solution and add the reference of the class library to the windows form project. After building the solution you will see that in the toolbox there will be a new control which can be used like a normal check box.
Hope this helps.
PS: I have used VS2008 for this, just so you know.
|
|
|
|
|
|
Majid Kamali
posted
166 posts
since
Jul 13, 2010
from
Iran, Tehran
|
|
Re: Problem with changing Radiobutton Color
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|