Link to home
Start Free TrialLog in
Avatar of wise_man
wise_man

asked on

Right Align Column in CListCtrl

I'm trying to make my CListCtrl (LVS_REPORT) column right align by using:
LV_COLUMN            lvColumn;

lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;

The problem is this method fail to set the first column to right align. All column except first column can be set.
Did any of you know what's going wrong ?
Avatar of galkin
galkin

If you want to change the order of columns in list view control you can use message LVM_SETCOLUMNORDERARRAY. Parameters are
LPARAM is Address of an array that specifies the order in which columns should be displayed, in left-to-right order. For example, if the contents of the array are {2,0,1}, the control displays column 2, column 0, and column 1 in that order.
WPARAM is size, in elements, of the buffer at array. You can also use macro ListView_SetColumnOrderArray instead. But remember, that this message is supported only for comctl32.dll version 4.70 or higher installed by InetSDK or Internet Explorer 3.0 or higher.


Avatar of wise_man

ASKER

No, I don't want to change column order, I want to Left or Right Justify text inside the column.
ASKER CERTIFIED SOLUTION
Avatar of galkin
galkin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, owner draw will solve the problem, but is it really necessary ? why can't Microsoft make our live easier ?
Yes, owner draw will solve the problem, but is it really necessary ? why can't Microsoft make our live easier ?