CListBox取消高亮选中状态的功能:
来源:互联网 发布:德拉蒙德格林数据虎扑 编辑:程序博客网 时间:2024/05/24 05:12
今天实现了一个关于CListBox取消高亮选中状态的功能:
点击任意内容行,内容行高亮显示,点击内容行外位置,取消当前高亮,
- <p> CRect rect;
- CPoint point;
- int nSelectIndex = 0;</p><p>
- GetCursorPos(&point);//获取当前鼠标位置,相对屏幕坐标
- ::MapWindowPoints(NULL,m_ListBox.m_hWnd,&point,1);//将屏幕坐标转换为控件中坐标
- //单行选中模式
- /*nSelectIndex = m_ListBox.GetCurSel();//获取当前选中行
- if (nSelectIndex != LB_ERR)
- {
- m_ListBox.GetItemRect(nSelectIndex,&rect);//获取当前选中行矩形
- if (!rect.PtInRect(point))//判断是否在选中行坐标中
- {
- m_ListBox.SetCurSel(-1);//如果不在,设置当前选中行为-1
- }
- }*/</p><p> // 多行选中模式
- int nCount = m_ListBox.GetSelCount();
- CArray<int,int> aryListBoxSel;</p><p> if (nCount == LB_ERR || nCount < 1)
- {
- return ;
- }
- aryListBoxSel.SetSize(nCount);
- m_ListBox.GetSelItems(nCount, aryListBoxSel.GetData());
- for (int i = 0;i< nCount; i++)
- {
- m_ListBox.GetItemRect(aryListBoxSel[i],&rect);
- if (rect.PtInRect(point))
- {
- return ;
- }
- }</p><p> for (int i = 0;i< nCount; i++)
- {
- m_ListBox.SetSel(aryListBoxSel[i],FALSE);
- }</p>
0 0
- CListBox取消高亮选中状态的功能:
- 点击CListBox选中行外取消选中高亮状态
- tableView取消cell的选中状态和取消高亮状态
- 取消UITableViewCell的选中状态
- 取消TableViewCell的选中状态
- 取消tableViewCell的选中状态
- 取消UITableViewCell的选中状态
- 取消UITableview的选中状态
- 取消TableViewCell的选中状态
- tableView取消选中行的选中状态
- 选中某一item,高亮显示(CListCtrl CTreeCtrl CListBox)
- UITableView 的Cell取消高亮状态
- 取消按钮的高亮状态
- UITableViewCell的高亮和选中状态
- UITableViewCell的高亮和选中状态
- <单元格选中时的高亮状态>
- 取消input/select等选中后的高亮样式
- iphone -- 取消TableViewCell的选中状态
- 菜鸟级三层框架(EF+MVC)项目实战之 系列一 EF零基础创建领域模型
- android 的Handler
- 求抛物线直线相交面积题(Problem ID:1071)
- Android——AS VS Eclipse
- cocos2dx一路走来之<API学习:数据存储UserDefault>
- CListBox取消高亮选中状态的功能:
- Java开发牛人十大必备网站
- java连接mysql查询操作
- 史上最简洁明了的配置hexo+github打造属于自己github pages博客
- wampserver没有权限访问/在此服务器上解决方法
- AlphaBlend
- 【数据结构】检查元素出栈的合法性
- hdu3641 Treasure Hunting(灵活题,阶乘的素因子个数求法)
- android权限大全