Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A little listbox trickery
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00687505
Message ID:
00756602
Vues:
38
Hi Steve

I set the following properties on my list box:

BoundColumn = 3
ColumnCount = 2
ColumnWidths = "6,150"
RowSourceType = 0

Then I use the following code to load the list. I have methods that return the text display and image to display. You can just put the values you want instead. I use methods so I can override then in the application.
  With ThisForm.ListBox
    .AddItem(ID,.ListCount+1,3)
    .List(.ListCount,2)=.SetListText()
    .Picture(.ListCount)=.SetListPicture()
  EndWith
I use the 6 pixel wide column to show a narrow bitmap in the first column of the list box. The 2nd column shows the text and the 3rd column is not displayed but contains the record ID.

I then created bitmaps that were 8 pixels wide and 16 pixels high so that fit perfectly in the 1st column.

In my dblClick method I have:

This.Picture(This.ListIndex)=This.SetListPicture(llSelected)

That's it.

I wonder if you should use the ListIndex instead of the ListItemID because the picture property is an array.

>Simon,
>
>I tried this idea to place an indicator on a listitem when double click is done, but it did not display the BMP. The bmp was smaller than the row height and column width. Here is the Doubleclick method code:
>
>********
>IF thisform.list1.picture(thisform.list1.ListItemId) <> "check_sp.bmp"
>
>STORE thisform.list1.list(thisform.list1.ListItemId, 2) TO fld_out(fld_max+1)
>thisform.list1.picture(thisform.list1.ListItemId)= "check_sp.bmp"
>thisform.list2.AddListItem(fld_out(fld_max+1))
>
>ENDIF
>thisform.refresh
>********
>
>Can you help me?
>
>-steve
Simon White
dCipher Computing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform