How to change TextAlign to center in ListView?

Has anyone understood how I can change TextAlign to Center in ListView ? As shown in the photo, when I select Center from the list, it returns to Left , so I cannot select the Left option. is there any way to do this? I just want to put the cell text in the center, not the left.

screenshot

+5
source share
1 answer

You have a problem only for the first column, and you have no problems with other columns. From MSDN :

Due to a limitation in the base control, this property does not affect the first column of the ListView control, which always aligns to the left. To get around this limitation in the .NET Framework version 2.0, you can handle the ListView.DrawColumnHeader event and color the column heading yourself.

+1
source

Source: https://habr.com/ru/post/1234318/


All Articles