How To Create a Toolbar Containing a ComboBox (162249)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q162249 SUMMARY
A ToolBar is a class that is meant to be used with a variety of different
forms. Because of this, a ToolBar's ComboBox, which shows a list of items
relevant to the data shown on a particular form, generally will not be
populated until the ToolBar that contains it is bound to that form.
This article presents approaches to placing a ComboBox in a ToolBar, and
several different methods of populating a ComboBox.
Two of the ComboBoxes in Example 2 do not work, but they are intentionally
included to demonstrate that an object that is instantiated before the
object that contains it cannot be defined as having data from its container
as its RowSource. A ComboBox in a ToolBar is instantiated before the
ToolBar, which is instantiated before the formset (which ultimately
contains the ToolBar) is instantiated. The data shown in the ComboBox must
be defined from within the methods of the ComboBox, or placed there by
events that happen after the ComboBox is instantiated.
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbcode kbhowto kbOOP KB162249 |
---|
|