三、在对话框的OnInitDialog初始化函数中添加如下代码(对列表控件进行初始化):
m_lstcoudata.InsertColumn(0,"课程名称",LVCFMT_CENTER,100);
m_lstcoudata.InsertColumn(1,"是否主科",LVCFMT_CENTER,100);
m_lstcoudata.InsertColumn(2,"周课时",LVCFMT_CENTER,100);
m_lstcoudata.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
m_lstcoudata.SetBkColor(RGB(172,199,235));
m_lstcoudata.SetRowHeigt(40);
m_lstcoudata.SetFontHW(15,10);
GRADE *pgrd=CArrangeCourseApp::Adu .GetGrdPointer()->pnext;
for(int n=0;n<10;n++)
m_lstcoudata.InsertItem(n,"");
//ect rc;
m_lstcoudata.GetClientRect(&rc);
m_lstcoudata.SetColumnWidth(0,rc.Width()/2);
m_lstcoudata.SetColumnWidth(1,rc.Width()/4);
m_lstcoudata.SetColumnWidth(2,rc.Width()/4);