LV_COLUMN lvColumn;
lvColumn.mask = LVCF_TEXT |LVCF_WIDTH| LVCF_FMT |LVCF_SUBITEM;
lvColumn.cx = 40;
lvColumn.pszText ="序号";
lvColumn.iSubItem = 0;
lvColumn.fmt = LVCFMT_CENTER;
//Inserts the column
m_CoEdList.InsertColumn(0,&lvColumn);
lvColumn.iSubItem=1;
lvColumn.fmt = LVCFMT_CENTER;
lvColumn.cx = 140;
lvColumn.pszText="姓名";
m_CoEdList.InsertColumn(1,&lvColumn);
lvColumn.iSubItem=2;
lvColumn.fmt = LVCFMT_CENTER;
lvColumn.cx = 70;
lvColumn.pszText="性别";
m_CoEdList.InsertColumn(2,&lvColumn);
int k;
for(int j=0;j<10;j++)
{
CString str;
str.Format("%d",j+1);
k=m_CoEdList.InsertItem(j,str);
m_CoEdList.SetEditBox(k,1);
m_CoEdList.SetItemText(k,1,"请填写"); //进路始端
CStringArray ComboStrings;
ComboStrings.Add( "男" );
ComboStrings.Add( "女" );
m_CoEdList.SetComboBox(k, 2, ComboStrings);
m_CoEdList.SetItemText(k, 2, "请选择");
}
1