Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preselecing t Items in a ListBox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00393757
Message ID:
00394138
Vues:
11
>>How can I preselect Items in a ListBox on a form to display as Selected when the Form Loads
>>
>>The Following does NOT work
>>
>>nCount = THISFORM.LstID.ListCount
>>FOR n = 1 TO nCount
>> THISFORM.LstID.Selected(n) = .T.
>>NEXT
>>
>>Note : THISFORM.LstID.RowSourceType = 2 Alias
>>and THISFORM.LstID.MultiSelect = .T.
>
>You must either put your code in the form's Activate method, or, if it's in the form's Init, you must have a THIS.SETFOCU() in the Init of the listbox.

It won't work Barbara. What I've done was this:

1. Created firsttime property of the form initially set as .T.
2. Created custom method with this code:

If Thisform.firsttime
For i = 1 TO This.List1.ListCount
This.List1.Selected(i) = .T.
Endfor
Thisform.firsttime = .F.
Endif

3. Each object's MOUSEMOVE property especially FORM, should call the routine above for execution.

JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform