Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Right Align Column in ListView 6.0 / SP4?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00426701
Message ID:
00463681
Vues:
21
>>>>oColumnHeader = oListView.ColumnHeaders.Add(Index, Key, Text, Width, Alignment)
>i never goot it to work this way, but it did work when
>oListView.COLUMNHEADERS("MyColumn").ALIGNMENT=1
>
>>Question:
>>Has anyone else experience with this problem and, more important, a solution/work-around.
>
>The icons - and maybe your already aware of this - need to be contained by the imagelist control, and then:
>.listimages.add(1,"CHECKMRK",LoadPicture("CHECKMRK.ICO"))
>Then use the index (1) or key in the COLUMNHEADERS definition. If you use the arrows to designate the sort, they would both need to be in the image list and assigned in the Sort method. If this doesn't get you going, message back and I locate some script and and pass it along.
>There is a source example of ListView instanciation in files, COM/DCOM OLE Automation : ADO Query Analyzer.
>Terry

Showing the icons is not the problem, that works fine already.
The problem is the alignment of the listitems as soon as an icon is assigned to a columnheader. The listitems are always aligned to the left after assigning an icon.
The code for changing the icon is located in the ColumnClick of the listview.

PROCEDURE ColumnClick (COLUMNHEADER)
With This
IF .SortKey = (COLUMNHEADER.INDEX - 1) && current colukmn, toggle order .SortOrder = IIf(.SortOrder = 1, 0 , 1)
ELSE
.ColumnHeaders(.SortKey + 1).Icon = 0 && No sort, no icon
.SortKey = (COLUMNHEADER.INDEX - 1)
.SortOrder = 0 && Asc
ENDIF
COLUMNHEADER.ICON = .SortOrder + 1 && 10-01-01 JCG: Zet sort-icon
.SORTED = .T.
EndWith && This
ENDPROC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform