General information
Category:
ActiveX controls in 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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only