Information générale
Catégorie:
Codage, syntaxe et commandes
>You can simply assign a value to the list's value property.
>loList.Value = loList.List(loList.ListIndex)
Jim,
I'm calling the following code in two places, once when in form.Show() and once when a button is clicked:
loList.Requery()
loList.LISTINDEX = 1
loList.SELECTED(loList.LISTINDEX) = .T.
loList.VALUE = loList.LIST(loList.LISTINDEX)
It is the exact same code in both places. The code in the button works fine, the first item is auto selected and highlighted. The code in the form.Show appears to select the first item (it's got the selected box around the item) but it is not highlighted as if it was clicked. This is not that big of a deal, but it's driving me nuts that I can't figure out what the difference would be. Does it possibly have something to do with the way the screen is painted since the first call is before the form is actually visible? Apparently it has more to do with when it's called not how it's done since I can replace the
loList.VALUE = loList.LIST(loList.LISTINDEX)
With
loList.Selected(loList.ListIndex) = .T.
and it works as well in the click() event, but not the form.Show
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement