怎样做类似于delphi中的可以拖动的菜单?(50分)

  • 主题发起人 主题发起人 screen
  • 开始时间 开始时间
S

screen

Unregistered / Unconfirmed
GUEST, unregistred user!
delphi界面中的主菜单也是可以拖动的,不知道是怎么实现的.
请高手指教
 
那就象delphi那样把菜单放在CoolBar中呗.
 
If you want to dock two or more tool windows together:

1. Choose the View menu and the names of the tools you want to
dock together. For example, to dock together the Call Stack tool and
the Watches tool, choose View|Call Stack then View|Watches.

2. When the tool windows appear onscreen, drag one tool window
by clicking on its title bar and move it onto the other tool window.


3. When the drag outline narrows, release the mouse. The two
windows dock together.
For example, to dock the Call Stack and Watch List windows
together, drag the Watch List over the Call Stack window and drop it
when the outline narrows.
4. To view the hidden windows, click the tab with its name on
it. For example, to view the Call Stack window, click the Call Stack.


To undock a tool window from the tabbed tools window:
1. Choose the window you want to undock by clicking its tab.
For example, to undock the Watch list window, click the Watch List tab.

2. Drag the tool window away from tools window until the drag
outline widens and then release the mouse. The tool window becomes a
floating window.

For example, to undock the Watch List window from the tools window,
drag the Watch List window away from the tools window. The narrow
drag outline widens when you are no longer over a tools window
docking site.
 
使用用ToolBar97控件吧,还有源码.
 
使用coolbar控键,在许多参考书中都有讲.
 
CoolBar上的菜单项分明是一个个Button。
 

button 有muneitem属性..
 
需要使用CoolBar控件,步骤如下:
1.加入一个CoolBar.
2.设flag属性为true.
3.加入按钮,Caption设为主菜单的项目.
4.加入足够的TPopMenu控件,并做好子菜单.
5.将每一个botton的muneitem属性设为对应的的TPopMenu.
6.执行程序,看看是不是好了? ;)
 
cartersun讲的最详细,分又少,不好再分了.就全给他吧.
对其他同志也表示感谢.
 
后退
顶部