I wasn\'t able to find an answer anywhere about this seemingly simple topic: is it possible to align text of a single subitem in a WinForms ListView control?
Building on the answer by @Fueled, here's what I did to use the column header alignment:
protected override void OnDrawSubItem( DrawListViewSubItemEventArgs e )
{
// Match the subitem alignment to the column header alignment
TextFormatFlags flags = TextFormatFlags.Left;
switch ( this.Columns[ e.ColumnIndex ].TextAlign )
{
case HorizontalAlignment.Right:
flags = TextFormatFlags.Right;
break;
case HorizontalAlignment.Center:
flags = TextFormatFlags.HorizontalCenter;
break;
}
e.DrawText( flags );
}