'm sure you are as anxious as I am to explore new properties, events, and methods, new or improved commands, and FoxPro Foundation Classes (FFCs). Let's dive right in!
Before Visual FoxPro 8, many lines of code had to be written in order to properly resize onscreen controls whenever a form was resized. In Visual FoxPro 8, that task got slightly easier with the introduction of the BindEvent
function. In Visual FoxPro 9, it gets way easier with the introduction of anchoring
. Anchors allow a control to maintain its proportional relationship with other objects and controls within a form, no matter what size the form becomes.
The Anchor property is obeyed when the control sits on containers such as Forms, CommandGroups, and Page objects. Whenever those containers get resized, the controls within it that have the Anchor property set are resized and/or repositioned depending on the settings used. Make sure to check out the Anchor Property topic in the Help file for available settings.
|Figure 1. Docking Example: Docking user-defined windows is simple.|
Docking allows toolbars and other controls to be "attached" to any user-chosen edge of a Form and maintain that positioning despite resizing or scrolling. Visual FoxPro 8 introduced the ability to dock objects, such as the Command, Document View, and Properties windows, as well commands and functions that handled docking programmatically.
Visual FoxPro 9 goes a step further and introduces the docking capability to user-defined forms as well. That enables creating dockable Forms on the IDE or on the application delivered to the users.
In order to support this feature, new members were added to the Form class, such as the Dockable and Docked properties, the Dock and GetDockState methods, and the AfterDock, BeforeDock, and UnDock events. Listing 1 shows a simple example that produces the result in Figure 1.
|As is common with every new version of Visual FoxPro, new commands, properties, methods, and events are introduced. This article highlights some of these new features to make the introductions, but you'll want to look at the "What's New" section on the Help file, because there's a lot more in there.