.h中
CListCtrl m_list;
.cpp中
在Dialog的OnInitDialog函数中
m_list.InsertColumn(0,"aa",LVCFMT_CENTER,155);
m_list.InsertItem(1,"强迫能量不可用率");
m_list.InsertItem(2,"单极强迫停运率");
m_list.InsertItem(3,"部分双极停运率");
m_list.InsertItem(4,"双极停运强迫停运率");
m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); 但是没有反应,怎么办呀?
CListCtrl m_list;
.cpp中
在Dialog的OnInitDialog函数中
m_list.InsertColumn(0,"aa",LVCFMT_CENTER,155);
m_list.InsertItem(1,"强迫能量不可用率");
m_list.InsertItem(2,"单极强迫停运率");
m_list.InsertItem(3,"部分双极停运率");
m_list.InsertItem(4,"双极停运强迫停运率");
m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); 但是没有反应,怎么办呀?
把ListCtrl的资源属性设置为“一直显示选择”,或者用程序加上LVS_SHOWSELALWAYS风格。
listctrl添加属性always show selection
改变tab顺序,在layout->tab order,将你的ListControl 改为1