DELPHI7实现XP菜单风格

文章介绍了如何在Delphi7环境下,通过CoolBar、ActionMainMenuBar、PageScroller和ActionToolBar等组件,不依赖第三方控件,手动设置属性和ActionManager来创建可拖动的XP风格菜单,包括添加菜单项和子菜单项的步骤。
摘要由CSDN通过智能技术生成

在DELPHI7中不使用任何第三方控件,实现放在工具栏上可拖动的XP风格菜单
今天有点空闲时间,顺便写点东西,不是什么深奥的东西,但实用,对于不想第三方控件但又想加点效果的朋友可能有点用.实现的效果如图:

 步骤一:把Win32面板上把CoolBar组件加到窗体上

步骤二:把Additional面板上的ActionMainMenuBar组件加到CoolBar组件上.(注意一定要放在CooBar 组件上)

步骤三:把Win32面板上的PageScroller组件同样加到CoolBar组件上.

步骤四:把Additional面板上的ActionToolBar组件加到PageScrooler组件上(注意放在PageScroolerh 上)

步骤五:把Additional面板上的ActionManager组件加到窗体上

步骤六:把CoolBar组件的AutoSize属性设为True

步骤七:选择ActionManager组件,双击它的的ActionBars属性,在弹出的Editing ActionManager1.ActionBars框中增加两个TActionBarItem,选择第一个TActionBarItem,双击它的Items属性,在弹出的框中增加两个ActionClientItem,把两个ActionClientItem的Caption属性分别设成"文件" ,"编辑", 再在ActionClientItem中的Items属性增加ActionClientItem, 并把它们的Caption属设成"新建","打开"之类的.如果你想在新建里面再出现子菜单,那么就在它的Items属性再增加ActionClientItem,设好Caption内容. 选择第二个TActionBarItem,按照上面所讲的方法同样增加ActionClientItem,并设好Caption属性.

步骤八:选择第一个TActionBarItem, 设它的ActionBar属性为ActionMainMenuBar,选第二个TActionBarItem,设它的ActionBar属性为ActionToolBar.

步骤九:运行程序,相信你已经看到所图所示的效果.致于其它很多属性,读者自己去分析.

FlatStyle .........\vcl_flatstyle .........\.............\vcl_flatstyle7 .........\.............\..............\Packages .........\.............\..............\........\FlatStyle_D5.cfg,382,2001-07-01 .........\.............\..............\........\FlatStyle_D5.dcu,4531,2001-07-01 .........\.............\..............\........\FlatStyle_D5.dof,1240,2001-07-01 .........\.............\..............\........\FlatStyle_D5.dpk,2301,2001-07-01 .........\.............\..............\........\FlatStyle_D5.res,1536,2001-07-01 .........\.............\..............\........\FlatStyle_D6.cfg,390,2002-08-29 .........\.............\..............\........\FlatStyle_D6.dcu,5009,2002-08-29 .........\.............\..............\........\FlatStyle_D6.dof,1421,2002-08-29 .........\.............\..............\........\FlatStyle_D6.dpk,2250,2001-07-01 .........\.............\..............\........\FlatStyle_D6.dsk,2462,2001-07-01 .........\.............\..............\........\FlatStyle_D6.res,1536,2001-07-01 .........\.............\..............\........\FlatStyle_D7.cfg,438,2004-10-26 .........\.............\..............\........\FlatStyle_D7.dcu,6183,2004-10-26 .........\.............\..............\........\FlatStyle_D7.dof,2023,2004-10-26 .........\.............\..............\........\FlatStyle_D7.dpk,2250,2001-07-01 .........\.............\..............\........\FlatStyle_D7.dsk,2568,2002-09-09 .........\.............\..............\........\FlatStyle_D7.res,1536,2001-07-01 .........\.............\..............\Source .........\.............\..............\......\DFS.INC,8673,2001-06-29 .........\.............\..............\......\FlatArrow.res,372,2001-06-29 .........\.............\..............\......\FlatGraphics.dcu,1710,2002-09-09 .........\.............\..............\......\FlatGraphics.pas,2168,2001-06-29 .........\.............\..............\......\FlatSound.res,71508,2001-06-29 .........\.............\..............\......\FlatUtilitys.dcu,11988,2002-09-09 .........\.............\..............\......\FlatUtilitys.pas,11687,2001-06-29 .........\.............\..............\......\HSLUtils.dcu,3209,2002-09-09 .........\.............\..............\......\HSLUtils.pas,4174,2001-06-29 .........\.............\..............\......\TFlatAnimationUnit.dcu,15066,2002-09-09 .........\.............\..............\......\TFlatAnimationUnit.pas,12001,2001-06-29 .........\.............\..............\......\TFlatAnimWndUnit.dcu,9884,2002-09-09 .........\.............\..............\......\TFlatAnimWndUnit.pas,6336,2001-06-29 .........\.............\..............\......\TFlatButtonUnit.dcu,28259,2002-09-09 .........\.............\..............\......\TFlatButtonUnit.pas,24710,2001-06-29 .........\.............\..............\......\TFlatCheckBoxUnit.dcu,20650,2002-09-09 .........\.............\..............\......\TFlatCheckBoxUnit.pas,15453,2001-06-29 .........\.............\..............\......\TFlatCheckListBoxUnit.dcu,27040,2002-09-09 .........\.............\..............\......\TFlatCheckListBoxUnit.pas,25105,2001-06-29 .........\.............\..............\......\TFlatColorComboBoxUnit.dcu,27520,2002-09-09 .........\.............\..............\......\TFlatColorComboBoxUnit.pas,19775,2001-06-29 .........\.............\..............\......\TFlatComboBoxUnit.dcu,21667,2002-09-09 .........\.............\..............\......\TFlatComboBoxUnit.pas,13785,2001-06-29 .........\.............\..............\......\TFlatDesignRegister.dcu,6690,2001-07-01 .........\.............\..............\......\TFlatDesignRegister.pas,5137,2001-07-01 .........\.............\..............\......\TFlatEditUnit.dcu,17400,2002-09-09 .........\.............\..............\......\TFlatEditUnit.pas,10760,2001-06-29 .........\.............\..............\......\TFlatGaugeUnit.dcu,10185,2002-09-09 .........\.............\..............\......\TFlatGaugeUnit.pas,7556,2001-07-01 .........\.............\..............\......\TFlatGroupBoxUnit.dcu,14451,2002-09-09 .........\.............\..............\......\TFlatGroupBoxUnit.pas,10964,2001-06-29 .........\.............\..............\......\TFlatHintUnit.dcu,15818,2002-09-09 .........\.............\..............\......\TFlatHintUnit.pas,12646,2001-06-29 .........\.............\..............\......\TFlatListBoxUnit.dcu,25421,2002-09-09 .........\.............\..............\......\TFlatListBoxUnit.pas,22127,2001-06-29 .........\.............\..............\......\TFlatMaskEditUnit.dcu,16638,2002-09-09 .........\.............\..............\......\TFlatMaskEditUnit.pas,9655,2001-06-29 .........\.............\..............\......\TFlatMemoUnit.dcu,14856,2002-09-09 .........\.............\..............\......\TFlatMemoUnit.pas,8473,2001-06-29 .........\.............\..............\......\TFlatPanelUnit.dcu,10308,2002-09-09 .........\.............\..............\......\TFlatPanelUnit.pas,4805,2001-06-29 .........\.............\..............\......\TFlatProgressBarUnit.dcu,12657,2002-09-09 .........\.............\..............\......\TFlatProgressBarUnit.pas,11030,2001-06-29 .........\.............\..............\......\TFlatRadioButtonUnit.dcu,20512,2002-09-09 .........\.............\..............\......\TFlatRadioButtonUnit.pas,15276,2001-06-29 .........\.............\..............\......\TFlatRegister.dcr,11732,2001-06-29 .........\.............\..............\......\TFlatRegister.dcu,3463,2002-09-09 .........\.............\..............\......\TFlatRegister.pas,1324,2001-06-29 .........\.............\..............\......\TFlatScrollbarUnit.dcu,33164,2002-09-09 .........\.............\..............\......\TFlatScrollbarUnit.pas,31957,2001-06-29 .........\.............\..............\......\TFlatScrollbarUnit.res,9996,2001-06-29 .........\.............\..............\......\TFlatSoundUnit.dcu,3106,2002-09-09 .........\.............\..............\......\TFlatSoundUnit.pas,1820,2001-06-29 .........\.............\..............\......\TFlatSpeedButtonUnit.dcu,24834,2002-09-09 .........\.............\..............\......\TFlatSpeedButtonUnit.pas,22668,2001-06-29 .........\.............\..............\......\TFlatSpinButtonUnit.dcu,14577,2002-09-09 .........\.............\..............\......\TFlatSpinButtonUnit.pas,9502,2001-06-29 .........\.............\..............\......\TFlatSpinEditUnit.dcu,27146,2002-09-09 .........\.............\..............\......\TFlatSpinEditUnit.pas,16383,2001-06-29 .........\.............\..............\......\TFlatSplitterUnit.dcu,15292,2002-09-09 .........\.............\..............\......\TFlatSplitterUnit.pas,10697,2001-06-29 .........\.............\..............\......\TFlatTabControlUnit.dcu,21602,2002-09-09 .........\.............\..............\......\TFlatTabControlUnit.pas,19674,2001-06-29 .........\.............\..............\......\TFlatTitlebarUnit.dcu,10441,2002-09-09 .........\.............\..............\......\TFlatTitlebarUnit.pas,6386,2001-06-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ok060

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值