Click to See Complete Forum and Search --> : Radio buttons in menu
danutz_plusplus
December 26th, 2006, 01:59 PM
Hi guys. I'm trying to add two radio buttons in a dropdown menu. Just like the radio buttons used by Windows Calculator to move from Standard View to the Scientific View, in the View menu. I searched the Toolbox, from C# 2005 express btw, but I couldn't find anything. The only thing close to it is the checked property, but it doesn't look very good. So I was wondering if you guys might know how I can do that. Thanks in advance.
Blacklazy
December 26th, 2006, 07:49 PM
In VS03 you just need to set the radio check property. I guess they don't allow you to do it anymore with 05 because the radio check property is missing, either that or they moved it someplace else.
wise programmer
December 27th, 2006, 02:59 AM
set the checked property==true & radio check==true of the selected menu item.
Code:
this.menuItem2.Checked = true;
this.menuItem2.RadioCheck = true;
hope it will help.
danutz_plusplus
December 27th, 2006, 03:04 AM
set the checked property==true & radio check==true of the selected menu item.
Code:
this.menuItem2.Checked = true;
this.menuItem2.RadioCheck = true;
hope it will help.
Well, there is no RadioCheck property. There is only the Checked property. Maybe it's as Blacklazy said and there is no such property in VC#2005(express).
wise programmer
December 27th, 2006, 03:23 AM
these two properties are available in vs2003.
danutz_plusplus
December 27th, 2006, 03:25 AM
Ok. Thanks everyone. It looks like I'll have to do it with the Checked property.
Blacklazy
December 27th, 2006, 12:41 PM
According to MS the RadioCheck property was removed. This is because the menu control in VS05 is a completely different control then what was used in VS03. It was designed to allow you to use some more advanced features and also enable visual styles.
Microsoft recommends you derive from ToolStripButton and implement your own RadioCheck property, but I think its a bit of an overkill as the new menu control support images.
Why not just open up Photoshop, or even Paint and draw a little dot the way you want it. Then save it as a bitmap and set it to the menus image property. Then when the user clicks the menu simply change the image. If the menu item is checked the image is visible, if not the image is removed. This is basically what you would be doing if you implemented a new version of the control anyway. That little check mark you see is just the image property being set to a checkbox bitmap stored in some DLL file. Its the same thing. Since its so easy to do, this may be the reason they decided not to include the RadioCheck property anymore to begin with. In VS03 it would have been a lot harder to set the image property of a menu item.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=7633&SiteID=1
Blacklazy
December 27th, 2006, 01:02 PM
In fact, here you go. I even made the button for you. You may have to work with the transparency if the white doesnt work for you.
Let me know if you need anything else.
danutz_plusplus
December 28th, 2006, 02:23 AM
In fact, here you go. I even made the button for you. You may have to work with the transparency if the white doesnt work for you.
Let me know if you need anything else.
Thanks man. For your help. I already did something like this, but I didn't how to make the white area transparent. I'll have to work on it as you said. Thanks again.
btw: is there a property where I can make the white area transparent?
EDIT: Ok, i managed to make the white area transparent and it worked. Thanks again.
Blacklazy
December 28th, 2006, 12:09 PM
np, glad it works for you.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.