Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Right Align Column in ListView 6.0 / SP4?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00426701
Message ID:
00463685
Views:
14
>>>>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

It doesn't get me going, so here a reply:

Sorry for sending the few previous messages, I pressed by accident the send button, using TAB and SPACE.

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 imagelist contains 2 icons (triangels, like in windows explorer). The first is a traingle pointing up, second is pointing down. They are shown properly in the columnheaders, when i use the code below.
The alignment stays left aligned, even when assigning 0 to the icon-property
The code I use for changing the icon is located in the ColumnClick of the listview:

PROCEDURE ColumnClick (COLUMNHEADER)
With This && oListView
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 && Set icon (i.e. 1 or 2)
.SORTED = .T.
EndWith && This
ENDPROC && ColumnClick

TIA

Jan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform