如何在mfc中单击外部列表控件框时取消选择项目 [英] How to deselect item when click outside list control box in mfc

查看:98
本文介绍了如何在mfc中单击外部列表控件框时取消选择项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MFC中创建了一个列表控件框。我单击了Row并选择了Row.Now如果我单击该对话框上此列表控件框之外的任何位置,则应取消选择该Row。我已经通过但无法找到任何帮助或解决方案,请帮助我,因为我是MFC的新手。

谢谢

解决方案

< blockquote>使用 CListBox :: SetCurSel [ ^ ]功能可以清除选择,可能在 OnKillFocus [ ^ ]覆盖。


I have created one list control box in MFC. I have clicked on Row and that Row is selected.Now If I click anywhere outside of this list control box on that dialogue, that Row should be deselected. I have gone through but not able to find any help or solution, please help me out, As I am new to MFC.
Thanks

解决方案

Use the CListBox::SetCurSel[^] function to clear the selection, probably in the OnKillFocus[^] override.


这篇关于如何在mfc中单击外部列表控件框时取消选择项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆