Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List box . . .

Status
Not open for further replies.

ShyFox

Programmer
Mar 22, 2003
210
ES
hy
How can I find the basic components of a list box?
I would like to recreate it from scratch.
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
ShyFox

I'm not sure what you mean. A listBox is a control in VFP (like a command button) that is part of VFP baseclass, that you can use in your development. Do you mean "invent" a new control? Most of VFP is written in C++, are you familiar with C++?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
What do you mean by "Re-Create it from scratch"?

If you mean, how do you set it up, You need to set these properties:

BoundTo = .T. (Required when BoundColumn is numeric, but doesn't hurt anything if the BoundColumn is Character)

ControlSource = Field in Table to update
RowSourceType
RowSource
BoundColumn.

So what are BoundTo and BoundColumn used for?
These properties determine how the control gets its value. The value of a combo or list box is taken from the column of its internal list that is specified by its BoundColumn. A combo box's DisplayValue, the value that is displayed in the text portion of the control, always comes from column one! Its value, on the other hand, can be taken from any column of its internal list. This means you can display meaningful text, such as the description from a lookup table, at the same time the control gets its value from the associated key. You do not even have to display this associated key in the list to have access to it.

For example, suppose the user must assign a particular contact type to each contact when it is entered. The appropriate contact type can be selected from a DropDown List with its RowSourceType set to 6-Fields, its RowSource set to “ContactType.CT_Type, CT_Key” where CT_Type is the description and CT_Key is its associated key in the ContactType table. To set up the control, first set the DropDown List's ColumnCount to 2 and its ColumnWidths to 150, 0. Then set the BoundColumn to 2 to update the bound field in the Contacts table from the key value instead of the description.


Marcia G. Akins
 
mgagnon (Programmer)
Yes Mike, I'm familiar with C\C++ langauge. That's my first language. But I didn't know that most of VFP is written in C++. Thank you for this piece of info.
And yes I do want to 'invent' a new list control.
Thank you for showing me the path.
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top