将主菜单继承到menu-strip? [英] inheritance main-menu into menu-strip?

查看:50
本文介绍了将主菜单继承到menu-strip?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我想知道我如何继续主菜单无线电检查功能进入菜单条主菜单有无线电检查但它不能在菜单中显示图标所以我想要做的是使用主菜单无线电检查进入菜单条进行选项选择菜单

例如这个

http ://i.imgur.com/1YAAViz.jpg [ ^ ]

(来自vlc播放器)

这个菜单也有图标和无线电检查选项

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

推荐答案

这是Windows窗体中的菜单项。和所有其他对象一样,对象附加了一些属性。同样,您可以调用不同的方法和函数来更改Windows窗体应用程序中对象的属性。



例如以下示例,



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,

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





..这将为您完成工作。



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



正如您所说,您想知道如何将属性添加到控件中。这是一个基本的代码来做你要问的事情,





..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,

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





..问题是您使用其名称调用控件,然后使用它拥有的属性。在上面的代码中,我选择了控件并修改了它的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.


这篇关于将主菜单继承到menu-strip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆