Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drop Down Combo Box doesn't display after selection
Message
 
 
À
11/05/2007 14:56:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01224715
Message ID:
01224783
Vues:
13
What do you mean here?

>Combobox already has an internal Listitem array. Why do you need in another one?
>
>>Everything is OK except that you don't need all of the LostFocus code.
>>
>>Actually, since you're doing something, leave two last lines of code. But you don't need to use replace in case of bound combo.
>>
>>>Okay, here's what I ended up doing. I took your advice, and made this an Array for the RowSource. Using an Array is really my preferred method of doing ComboBox Lists.
>>>
>>>
>>>* The FORM LOAD event:
>>>WITH ThisForm
>>>   This.DoSets()
>>>   .cTable="certs"
>>>   * Put values into the Form's .aBend[3,2] array.
>>>   .aBend[1,1]="Not Tested"
>>>   .aBend[1,2]=" "
>>>   .aBend[2,1]="Pass      "
>>>   .aBend[2,2]="P"
>>>   .aBend[3,1]="Fail      "
>>>   .aBend[3,2]="F"
>>>   * Put values into the Form's .aWrap[3,2] array.
>>>   .aWrap[1,1]="Not Tested"
>>>   .aWrap[1,2]=" "
>>>   .aWrap[2,1]="Pass      "
>>>   .aWrap[2,2]="P"
>>>   .aWrap[3,1]="Fail      "
>>>   .aWrap[3,2]="F"
>>>ENDWITH
>>>
>>>* The FORM INIT event:
>>>This.ListIndex = 1
>>>
>>>* ThisForm.cboBend.LostFocus()
>>>WITH ThisForm
>>>   DO CASE
>>>      CASE This.ListIndex = 1   && Not Tested
>>>         REPLACE Certs.Bend WITH " "
>>>			
>>>      CASE This.ListIndex = 2   && Pass
>>>         REPLACE Certs.Bend WITH "P"
>>>		
>>>      CASE This.ListIndex = 3   && Fail
>>>         REPLACE Certs.Bend WITH "F"
>>>			
>>>   ENDCASE
>>>   .SaveCancelStatus()
>>>   .Refresh()
>>>ENDWITH
>>>
>>>
>>>
>>>
>>>*The ComboBox was set to:
>>>cboBend.BoundColumn=2
>>>cboBend.BoundTo=.T.
>>>cboBend.ColumnCount=2
>>>cboBend.ControlSource="Certs.Bend"
>>>cboBend.FontName="Courier New"
>>>cboBend.RowSource="ThisForm.aBend"
>>>cboBend.RowSource=5 (Array)
>>>
>>>
>>>>You're not displaying the value anyway.
>>>
>>>>I would, actually, do it a bit differently. If you want to use value, then, >I think:
>>>
>>>>RowSource = 'No value,N,My Second Choice,M,My ThirdChoice,T'
>>>
>>>>RowSourceType = 1 && Value
>>>>controlsource = myTable.MyField
>>>>BoundColumn = 2
>>>>ColumnCount = 2
>>>
>>>>Something like that. I actually always prefer to use either cursor or an array for my combos, that's why I can not write exactly from the top of my head.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform