Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

How to access RadioButton's round cycle/dot graphics?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
strout - 15 Feb 2005 19:15 GMT
What I am trying to do is to change the round button background to grey and
still keep the text label black, by overriding the "Enabled" property.

The purpose is to keep the radio button reader-friendly while keep it
non-editible.

Somemhow I didn't find any property exposed to change the button's
background color. Well, there IS a  backcolor property but the color applies
to the whole button area including the text area. I want to change the little
round-dot button only.

Thanks

strout
VBen - 15 Feb 2005 19:24 GMT
Have you tried inheriting from the RadioButton, and overriding the OnPaint
method? (I'm sure there's somewhere a procedure to draw the ratiobutton's
circle, but I can't remember which or in which DLL). There's no backcolor
property for the circle, since it is drawn using this routine. You could
draw your own circle.
The other solution I can find is to draw a ratiobutton without any text, and
a Label that holds the text. OnClick of the label, you can change the value
of the ratiobutton to simulate the click on the ratiobutton's text, and you
can still "disable" the ratiobutton, so it gets drawn disabled.
Hope this helps.
VBen.

> What I am trying to do is to change the round button background to grey and
> still keep the text label black, by overriding the "Enabled" property.
[quoted text clipped - 10 lines]
>
> strout
Phil Williams - 16 Feb 2005 11:09 GMT
Strout,
Why not delete the radiobutton's Text property so it's blank, and add a
label control to the right of the radiobutton?

Regards,
Phil.

> What I am trying to do is to change the round button background to grey and
> still keep the text label black, by overriding the "Enabled" property.
[quoted text clipped - 10 lines]
>
> strout
strout - 17 Feb 2005 00:45 GMT
Thak you all

I added a usercontrol having a radio button and a label. Big problem is
solved.

Somehow I didn't get the ControlPaint.DrawFocusRectangle work. I try to draw
a focus rectangle around the usercontrol when get focus but the lost focus
event fired immediately after gotfocus. It end up drawing nothing.

It's not perfect so far and I gave up.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.