Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change TextAlign to Center in the ListView? [duplicate]

Has anyone got any idea in how can I change TextAlign to Center in the ListView? As it is shown in the photo, when I select Center from the list it goes back to Left so I cant select Left option. is there a way of doing that? I just want to place the cell text to the center instead of left.

screenshot

like image 912
naouf Avatar asked Oct 22 '15 20:10

naouf


1 Answers

You have problem just for first column and you haven't problem with other columns. From MSDN:

Due to a limitation in the underlying control, this property has no effect on the first column in the ListView control, which is always aligned to the left. To work around this limitation in .NET Framework version 2.0, you can handle the ListView.DrawColumnHeader event and paint the column header yourself.

like image 88
Salah Akbari Avatar answered Nov 15 '22 07:11

Salah Akbari