我想选中列表控件(listctrl)中的某一列,并改变选中列的颜色,请问改如何做?谢谢!
解决方案 »
- 本人新手, 想问下, 怎么WSAAsyncSelect模型编写客户端
- 新手求助, message in tab control->staic control->other control
- 如何发送alt+ctrl+enter消组合键消息
- unhandled exception in **.exe(aria.dll)错误求教
- 如何防止SQL注入
- 我现在在EVC下建立了一个基于对话框的程序,但是想在里面添加菜单,不知道如何添加!
- MAILSERVER问题,反正分也没什么用,顺便散分
- 装了.net后没法用vc调式了,着急ing
- 关于一个图形化的按钮。。。
- sndPlaySound函数播放声音求指点
- 如何选中列表控件中的某一列?
- 如何防止软件被拷贝使用?
WM_CTLCOLORLISTBOX
The WM_CTLCOLORLISTBOX message is sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. A window receives this message through its WindowProc function. LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_CTLCOLORLISTBOX
WPARAM wParam, // handle to DC (HDC)
LPARAM lParam // handle to list box (HWND)
);
m_ctrl.AddString("2");
m_ctrl.AddString("3");
m_ctrl.AddString("4"); m_ctrl.SetCurSel(2);
改变listctrl选择项可以用SetItemState
list.SetCurSel(?);
CString sendDir;
POSITION pos=m_ListSearch.GetFirstSelectedItemPosition();
strd=m_ListSearch.GetItemText(m_ListSearch.GetNextSelectedItem(pos),NULL);
http://www.codeguru.com/listview/CListCtrlEx.html