Re: LVS_EX_HEADERDRAGDROP List Control.
You want to disable _resize_, not just drag-drop. See HDN_BEGINTRACK
<aloha826@gmail.com> wrote in message
news:e3ea7ac5-7920-4a67-b4bb-4179fa751daa@z28g2000prd.googlegroups.com...
Hi,
I want to disable my column drag and drop in my list control box (type
report). I'm using VC++ 6.0
I have below code, and it displays OK, except that I want to disable
user from drag all the column.
I didn't enable LVS_EX_HEADERDRAGDROP, but still the columns are
draggable.
How can I disable user from dragging the column, so that no scroll bar
can appear horizontally.
BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
LVCOLUMN lvColumn;
int nCol;
lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 201;
lvColumn.pszText = "Name";
nCol = m_List1.InsertColumn(0, &lvColumn);
lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 200;
lvColumn.pszText = "Address";
m_List1.InsertColumn(1, &lvColumn);
lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 80;
lvColumn.pszText = "Age";
m_List1.InsertColumn(2, &lvColumn);
lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 80;
lvColumn.pszText = "ID. No";
m_List1.InsertColumn(3, &lvColumn);
this->m_List1.SetExtendedStyle(LVS_EX_FULLROWSELECT |
LVS_EX_GRIDLINES);
....
return true;
}
Thanks.
Regards,
Kenji.