Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GOTO TOP in ComboBox
Message
 
 
To
19/09/2005 02:05:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01049365
Message ID:
01050824
Views:
30
Hi Gary,

It's a little bit hard for me to follow all the logic in the code. Did you try to verify content of the array? Where do you set rowsource for the combo? Did you try requery? Did you try with two dimensional array? Did you try to comment numberofelements line?

>Sorry, I was offline for a couple of days, code for LoadCombo() event is
>
>LOCAL lnselect,lnk
>lnselect=SELECT()
>lnk=0
>
>IF THIS.lCodeAtFront
>  THIS.BOUNDCOLUMN=1
>  IF THIS.Parent.Class<>"Column"
>    THIS.COLUMNWIDTHS=ALLTRIM(STR(THIS.WIDTH-12))+",150"
>  ENDIF
>  THIS.nCodeColumn=1
>  THIS.nDesColumn=2
>ENDIF
>
>DIMENSION THIS.aItems[1,3]
>THIS.aItems[1,THIS.nCodeColumn]=SPACE(THIS.Codewidth)
>THIS.aItems[1,THIS.nDesColumn]="Unknown"
>THIS.aItems[1,3]=999
>
>IF THIS.AllowUnknown
>  lnk=lnk+1
>ENDIF
>
>IF RIGHT(THIS.MasterfileId,THIS.nCodeColumn)="*"
>  THIS.MasterfileId=STRTRAN(THIS.MasterfileId,"*","")
>  THIS.lUseText=.T.
>ELSE
>  THIS.lUseText=.F.
>ENDIF
>
>SELECT 0
>USE ppmfil AGAIN ORDER mkey ALIAS mCombo
>IF !ISBLANK(THIS.mFilter)
>  lcFilter="SET FILTER TO "+THIS.mFilter
>  &lcFilter
>ENDIF
>LOCATE
>IF SEEK(THIS.MasterfileId)
>  SCAN FOR !ISBLANK(code) WHILE FileId=THIS.MasterfileId
>    lnk=lnk+1
>    DIMENSION THIS.aItems[lnk,3]
>    THIS.aItems[lnk,THIS.nCodeColumn]=Left(code,THIS.CodeWidth)
>    THIS.aItems[lnk,THIS.nDesColumn]=IIF(!THIS.lUseText,description,text1)
>    THIS.aItems[lnk,3]=value1
>  ENDSCAN
>ENDIF
>USE
>
>=ASORT(THIS.aItems,THIS.nCodeColumn)
>
>IF THIS.AllowNewItem
>  lnk=lnk+1
>  DIMENSION THIS.aItems[lnk,3]
>  THIS.aItems[lnk,THIS.nCodeColumn]=REPLICATE("+",THIS.Codewidth)
>  THIS.aItems[lnk,THIS.nDesColumn]="New Item"
>  THIS.aItems[lnk,3]=998
>ENDIF
>
>SELECT (lnselect)
>
>=ASORT(THIS.aItems,3)
>
>*) This is where I have tried to set the combo to top
>IF EMPTY(THIS.Value)
>  THIS.ListIndex=1
>ENDIF
>
>THIS.NUMBEROFELEMENTS=ALEN(THIS.aItems)
>
>
>
>
>
>Regards
>
>
>Gary.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform