I have a Delphi ListView with ViewStyle := vsReport. I'm displaying numeric data and would like to set all the columns to right justiied. I have been able to right justify all the columns except columns[0]. For some reason, columns[0] won't allow the taRightJustify. It only allows taLeftJustify.
Is it possible to set columns[0] to be right justified? If so how do you do this?
TListView
does not natively support what you are asking for, due to a Microsoft limitation rather than a VCL limitation:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb774743.aspx
The alignment of the leftmost column is always LVCFMT_LEFT; it cannot be changed.
The only way to align the text of columns[0] is to owner-draw it.
Otherwise, switch to another control, such as Virtual Treeview.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With