初始了一个表头,希望波形、峰值列在前面。但是下面的代码显示时,这两列在最后,怎么修改? lvcol.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvcol.fmt = LVCFMT_CENTER;
lvcol.pszText = "波形时刻";
lvcol.iSubItem = 0;
lvcol.cx = 70;
m_ListCtrl.InsertColumn(0, &lvcol);
lvcol.pszText = "峰值";
lvcol.iSubItem = 1;
lvcol.cx = 70;
m_ListCtrl.InsertColumn(1, &lvcol); for (i = 0; i <=21; i++)
{
lvcol.pszText = szHRI;
lvcol.iSubItem = i + 2;
lvcol.cx = 50;
m_ListCtrl.InsertColumn(i, &lvcol);
} LONG lStyle; //用report形式显示
lStyle = GetWindowLong(m_ListCtrl.m_hWnd, GWL_STYLE);
lStyle &= ~LVS_TYPEMASK;
lStyle |= LVS_REPORT;
SetWindowLong(m_ListCtrl.m_hWnd, GWL_STYLE, lStyle);
lvcol.fmt = LVCFMT_CENTER;
lvcol.pszText = "波形时刻";
lvcol.iSubItem = 0;
lvcol.cx = 70;
m_ListCtrl.InsertColumn(0, &lvcol);
lvcol.pszText = "峰值";
lvcol.iSubItem = 1;
lvcol.cx = 70;
m_ListCtrl.InsertColumn(1, &lvcol); for (i = 0; i <=21; i++)
{
lvcol.pszText = szHRI;
lvcol.iSubItem = i + 2;
lvcol.cx = 50;
m_ListCtrl.InsertColumn(i, &lvcol);
} LONG lStyle; //用report形式显示
lStyle = GetWindowLong(m_ListCtrl.m_hWnd, GWL_STYLE);
lStyle &= ~LVS_TYPEMASK;
lStyle |= LVS_REPORT;
SetWindowLong(m_ListCtrl.m_hWnd, GWL_STYLE, lStyle);
{
lvcol.pszText = szHRI;
lvcol.iSubItem = i + 2;
lvcol.cx = 50;
m_ListCtrl.InsertColumn(i, &lvcol);
}
从零开始,不是又把原来定义好的给冲掉了吗?
{
lvcol.pszText = szHRI;
lvcol.iSubItem = i + 2;
lvcol.cx = 50;
m_ListCtrl.InsertColumn(i, &lvcol);
}
从零开始,不是又把原来定义好的给冲掉了吗?
lStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP;
m_AlarmList1.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)lStyle);
LV_COLUMN lvc;
lvc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH /*| LVCF_FMT*/; lvcol.fmt = LVCFMT_CENTER;
lvcol.pszText = "波形时刻";
lvcol.iSubItem = 0;
lvcol.cx = 70;
......................
...........................
lvcol.iSubItem = i + 2;
ListCtrl.InsertColumn(i, &lvcol);