Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Invalid Key' error in listview
Message
 
To
24/09/2003 13:06:46
Michael Harris
Harris and Harris Consultants
Temple Hills, Maryland, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00831903
Message ID:
00832927
Views:
19
The loop that adds the items is faster than the .001 increments SYS(2015) uses.
A "primitive" delay is needed:
** A section in your add loop
lcCheckKey = Sys(2015)
do while sys(2015)=lcCheckKey && Delay loop
enddo
lcKey=sys(2015)
thisform.olecontrol3.ListItems.Add(,lcKey,'',thisform.imglstButtons.ListImagesi).Picture)
** end a section in your add loop
Make sure not to use a number for the first position in your key. Typically, you would use Keys from a table for the listview key.

You could also use the "C" in your FOR loop as a key, providing you place a character in front:
lcKey="_"+transform(c)



>The following code is in the init section of a form which has an Imagelist control and a Listview control. This code is used to populate the listview control, but I keep getting an "invalid key' error.
>
>
>*** Loading Icons into Image List ***
>For I = 1 To lnButtons &&Number of buttons
> thisform.imglstButtons.ListImages.Add(,,Loadpicture(laButtons(i,1)))
>Endfor
>thisform.olecontrol3.Icons = thisform.imglstButtons
>**thisform.olecontrol3.SmallIcons = thisform.imglstButtons
>
>*** Loading imagelist icons into listview ****
>For I = 1 To thisform.imglstButtons.listImages.count
> **thisform.olecontrol3.ListItems.Add(,,
> lcKey = Right(Sys(2015),6)
>Error ----- thisform.olecontrol3.ListItems.Add(,,'',thisform.imglstButtons.ListImages(i).Picture)
>Endfor
>
>If anyone can help me and help me better understand how this error is caused, I would greatly appreciated.
>
>MEH
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform