What is it?
Simple(ish) wrapper round TToolBar to create a Windows XP Explorer-style menu bar that works nicely across different versions of Windows.
But I can use a TToolBar directly for that…
For sure, back in the heady days of Windows 98 and a fully patched Delphi 4. Changes in the common control DLL since then has led to TToolBar requiring a variety of fixes if it is to still work well in this mode however; and what TXPMenuBar does, in short, is to provide exactly those fixes
How do I use it?
- Firstly, compile and install the design-time package, dclCCRXPMenuBar.dpk. This should lead to one new component being added to the component palette: TXPMenuBar.
- Ensure CCR.XPMenuBar.dcu is somewhere in your library paths — the easiest way to do this is to add the component’s directory as a library path itself. In Delphi 2007, you do this by going to Tools|Options, Environment Options -> Delphi Options -> Library – Win32, and clicking on the ellipsis button for ‘Library path’.
- Drop a TXPMenuBar onto your form and assign its Menu property to a TMainMenu instance. If it’s still enabled, the default menu bar should be removed by clearing the form’s Menu property, though my component should do that for you if and when you set things up at design time.
- For the full-on XP Explorer effect, put the TXPMenuBar (along with plain jane TToolBars) onto a TCoolBar. However, I suggest you avoid using the latter control though, since it looks crap on Vista.
Supported Delphi versions
Delphi 7 and greater.
MPL 1.1 (text here).