PRB: Disabled Items in List Box Become Enabled When List Box has Focus and RowSourceType is Not 5-Array (177157)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q177157

SYMPTOMS

Items disabled in a list box become enabled when the list box receives focus and the RowSourceType property of the list box is set to anything other than 5-Array.

CAUSE

This is caused by the refreshing of the list box values from the data source.

RESOLUTION

Set RowSourceType for the list box to 5-Array.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a form.
  2. Add a table to the DataEnvironment of the form.
  3. Add a list box object to the form.
  4. In the Click method of the list box, type the following code to disable an item that is clicked on:
          This.List(This.ListItemId)="\"
  5. Set the following properties of the list box:
          RowSource = <Tablename>
          RowSourceType = 2 - Alias
  6. Add a command button to the form.
  7. Save and run the form.
  8. Click on several items in the list box to disable them.
  9. Click the command button created in Step 6.
  10. Click or Tab into the list box to set focus to the list box.
NOTE: As soon as the focus returns to the list box all the disabled items are enabled.

REFERENCES

For more information on this, please see the following article in the Microsoft Knowledge Base:

129329 How to Populate a Form's ListBox Object from an Array


Modification Type:MajorLast Reviewed:12/11/1999
Keywords:kbprb KB177157 kbAudDeveloper