Oliver Kinne
May 19th, 1999, 09:47 AM
How do I make the first (i.e. leftmost) column right-align the text in it? This would be useful for a list of numbers. According to the help, CListCtrl's first column must be left-aligned. Any ideas?
|
Click to See Complete Forum and Search --> : Right aligning first column in CListCtrl Oliver Kinne May 19th, 1999, 09:47 AM How do I make the first (i.e. leftmost) column right-align the text in it? This would be useful for a list of numbers. According to the help, CListCtrl's first column must be left-aligned. Any ideas? Jim Watters May 19th, 1999, 06:19 PM The solution is to set the column again after it has been inserted. LV_COLUMN lvColumn; memset(&lvColumn, 0, sizeof(lvColumn)); lvColumn.mask = LVCF_FMT; m_MyListCtrl.GetColumn(0, &lvColumn); if((m_gListColumn[0].fmt & LVCFMT_RIGHT) == LVCFMT_RIGHT) lvColumn.fmt |= LVCFMT_RIGHT; else if(m_gListColumn[0].fmt & LVCFMT_CENTER) == LVCFMT_CENTER) lvColumn.fmt |= LVCFMT_CENTER; m_MyListCtrl.SetColumn(0, &lvColumn); Oliver Kinne May 20th, 1999, 03:28 AM Thank you very much. Works wonderfully. :-) codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |