VCL Examples

MenuToolBar.dpr is a project with code in its OnCreate handler to transform a normal main menu into an Office-style menu like Delphi 4's.

Actions.Dpr uses some pre-defined Actions to show their general use. Also, the new TControlBar is used to hold a couple of TToolBars, one of which contains a menu set up as in MenuToolBar.Dpr above.

ConstraintsAndAnchors.Dpr uses the new Anchors property to allow simple geometry management in an alternative way to the Align property of old. It also uses the Constraints property to restrict the size the form can be shrunk or grown to. The second form uses the OnConstrainedResize event to allow the form to grow bigger if the Shift key is held down.

ShortCutCapture.Dpr uses the new OnShortCut event to trap all keypresses on the form and then writes the textual name of the pressed key into a listbox.

VirtualListView.Dpr shows a very simple example of a virtual list view. This is a list view which holds no data. Instead, to cater for potentially huge numbers of items, whenever items need to be displayed, it triggers events to allow you to give itthe information it requires. Delphi comes with a rather more involved example, which also shows how to get access to lots of file and folder information in the manner of Windows Explorer, in Demos\Virtual ListView\VirtualListView.Dpr