Information générale
Catégorie:
Contrôles ActiveX en VFP
>>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement