问题描述
如何在下面的屏幕截图的 Project1 和 Quit 上方添加TMenuItem?
How to add TMenuItem under Project1 and above Quit on the screenshot below?
我创建了一个TMenuBar,并选中了UseOSMenu属性.我添加的第一个TMenuItem是主栏中的第二个...
I have created a TMenuBar with property UseOSMenu checked.The first TMenuItem I added is the second one in the main bar...
推荐答案
您可以通过将IItemsContainer实现类的TMenuBar分配给Application.ApplicationMenuItems属性来实现.
You can do this by assigning a TMenuBar of IItemsContainer implementing class to the Application.ApplicationMenuItems property.
示例:
如果表单上有一个名为MenuBar1的菜单栏组件,那么您只需在表单构造函数(或OnCreate)中调用以下内容即可.
If there was a menu bar component on the form called MenuBar1, then you would just call the following in your forms constructor (or OnCreate).
Application.ApplicationMenuItems := Menubar1;
然后您可以使用第二个TMenuBar组件来定义其他菜单项.
You can then have a second TMenuBar component to define the other menu items.
我会把您指向ApplicationMenuItems属性上的Wiki主题,但是它没有其他帮助...
I'd point you to the wiki topic on the ApplicationMenuItems property, but it has no additional help...
http://docwiki.embarcadero.com/VCL/XE2/en/FMX.Forms.TApplication.ApplicationMenuItems
这篇关于如何在OSX上的应用程序名称下创建子项菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!