Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ItemTips

ItemTips are cool. They’re tooltip-like windows that appear for items in a list that are too wide for the list box. Like tooltips, they appear when you pause the mouse over the item. No more making a list wide enough to accommodate the widest item. Just turn on ItemTips and choose a reasonable width.

Usage

lstList.ItemTips = lUseItemTips
lUseItemTips = lstList.ItemTips

Surprisingly, ItemTips can be changed at runtime. We find it hard to imagine a situation in which that would be good interface design—except, perhaps, for applications in which the user controls whether or not lists have item tips.

In VFP 5 (both the original version and 5.0a), item tips and private data sessions don't mix. When ItemTips is on in a form with a private data session, moving the mouse over the list gives the error "Cannot access selected table." This bug was fixed in VFP 6.

Item tips don't mix very well with multi-column lists, either. In VFP 5 (including 5.0a), the value of ItemTips is simply ignored in multi-column lists. No item tips appear. In VFP 6 and later, item tips appear only for the first column and only for items that would show an item tip if the whole width of the list were devoted to the first column. Microsoft says this is by design, but we think it's just stupid.

Example

* Create a form.
* Add the TasTrade customer table to the DE.
* Drop a list on a form and set properties as follows:
RowSourceType = 6 - Fields
RowSource = Customer.Company_Name
ItemTips = .T.
* Run the form and move the mouse over the items in the list.

See Also

ListBox, ShowTips, ToolTipText