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?
Printable View
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?
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);
Thank you very much. Works wonderfully.
:-)