Header control
-
how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.
-
how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.
-
You already created a thread for your question below. I don't understand your question. Could you rephrase it? Do you mean the text in the header control's alignment: left-align, center-align, right-align? this is this.
when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.
-
when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.
-
read more carefully about the method int InsertItem( int nPos, HDITEM* phdi ); it provides all you what 路漫漫其修远兮,吾将上下而求索。
read carefully my question! I want to apply right to left order to columns, not to text of items.
-
when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.
Just use zero for the index when you insert the columns.
InsertColumn(0, _T("Column far right")); InsertColumn(0, _T("Column 2nd from right")); InsertColumn(0, _T("Column 3rd from right"));
If you need it so the entire list control is flush with the right side on the control (say for arabic/hebrew reading) you'd need to set the Right to Left RTL Layout setting in the dialog that contains the control. In Italy for thirty years under the Borgias they had warfare, terror, murder, bloodshed - but they produced Michelangelo, Leonardo da Vinci and the Renaissance. In Switzerland they had brotherly love, five hundred years of democracy and what did that produce - the cuckoo clock! -- Harry Lime -
how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.
Insert a temporary column first, insert the other columns, then delete the temporary column, like:
m_lcFooter.InsertColumn(0, _T("David")); // temporary
m_lcFooter.InsertColumn(1, _T("Right Justified"), LVCFMT_RIGHT, 580);
m_lcFooter.InsertColumn(2, _T("Left Justified"), LVCFMT_LEFT, 75);
m_lcFooter.DeleteColumn(0);
// now insert the items
"One must learn from the bite of the fire to leave it alone." - Native American Proverb