Right align list column in list view.
-
-
I want the first column of my list view to be right aligned but it wont let me align it. I can align any of the other colums to the center or right but the first column is always left align. Is there a way to get the first column right aligned?
From MSDN If a column is added to a list-view control with index 0 (the leftmost column) and with LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column. Michael :-) Time flies like an arrow. Fruit flies like a banana
-
From MSDN If a column is added to a list-view control with index 0 (the leftmost column) and with LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column. Michael :-) Time flies like an arrow. Fruit flies like a banana
Wow, it's cool !!!!! Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com
-
From MSDN If a column is added to a list-view control with index 0 (the leftmost column) and with LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column. Michael :-) Time flies like an arrow. Fruit flies like a banana