Microsoft KB Archive/177157

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

Article ID: 177157

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



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.



Steps to Reproduce Behavior
 Create a form. Add a table to the DataEnvironment of the form. Add a list box object to the form.  In the Click method of the list box, type the following code to disable an item that is clicked on: This.List(This.ListItemId)="\"   Set the following properties of the list box: RowSource = <Tablename> RowSourceType = 2 - Alias </li> Add a command button to the form.</li> Save and run the form.</li> Click on several items in the list box to disable them.</li> Click the command button created in Step 6.</li> Click or Tab into the list box to set focus to the list box.</li></ol>

NOTE: As soon as the focus returns to the list box all the disabled items are enabled.

<div class="references_section">