Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello i want to know that how i can inherit the main menu radio check functionality into menu-strip main-menu has radio check but it cant show icon in menu so what i am trying to do is use main-menu radio check into menu strip to do the option choose in menu
for example this
http://i.imgur.com/1YAAViz.jpg[^]
(from vlc player)
this menu has icon and radio check option too
Posted
Updated 10-Sep-14 3:46am
v3
Comments
[no name] 10-Sep-14 9:48am    
http://www.codeproject.com/Questions/814360/how-to-show-radio-option-button-in-winform?arn=0
Sergey Alexandrovich Kryukov 11-Sep-14 0:49am    
Please explain what exactly do you mean by "inheritance" in this context.
—SA
Afzaal Ahmad Zeeshan 11-Sep-14 10:06am    
I don't think the word "inheritance" in any way, means to use the the inheritance of interface or class. He just wants to "use" that method.

1 solution

That is a menu item inside the Windows Form. And like all other objects, there are some properties attached to the objects. Similarly you can call different methods and function to change the properties of the object inside your Windows Forms application.

For example the following example,

C#
// create a new instance, 
MenuItem item = new MenuItem();
// radio check it..
item.RadioCheck = true;


..this will do the job for you.

http://msdn.microsoft.com/en-us/library/system.windows.forms.menuitem.radiocheck(v=vs.110).aspx[^]

As you've stated that you wanted to know, how to add the property to the control. Here is a basic code to do the thing you're asking,

C#
// suppose you're having a control with name menuItem, then you will do this
menuItem.RadioCheck = true; 


..the thing is that you call the control using its name and then you work with the property it has. In the above code, I have selected the control and modified its RadioCheck property and set it to true.
 
Share this answer
 
v2
Comments
tjnapster555 10-Sep-14 14:28pm    
so first i add menustrip then i add this
is there any tutorial?
Afzaal Ahmad Zeeshan 10-Sep-14 14:38pm    
If you're having a menu, then you can just add the RadioCheck property to it. That will do the job for you! :-)
tjnapster555 11-Sep-14 6:40am    
can you tell me or give me a link to how to add a property in menustrip i cant find how to add a property to control>>>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900