从列表控件中选择项目并在mfc vc ++中显示到编辑框中 [英] select item from list control and diplay into editbox in mfc vc++

查看:182
本文介绍了从列表控件中选择项目并在mfc vc ++中显示到编辑框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的对话框中有一个列表控件,其中包含名称列表。当选择一个特定名称时,将其显示在编辑框控件中。如何在mfc中执行此操作?更好的是提供一个简单的代码示例。

解决方案

此CodeProject文章提供了全面的概述:使用CListBox控件 [ ^ ]。



注意通知消息 LBN_SELCHANGE 在处理CListBox消息部分。



请参阅: LBN_SELCHANGE通知代码(Windows) [ ^ ]。



对于编辑框,您可以使用类 CEdit 。使用是您可能不需要其他解释的方式: CEdit类 [ ^ ]。



基本上,这就是你需要知道的全部。



祝你好运。

-SA


您使用的是CListCtrl吗?如果是,请参阅 visual c ++ - 如何检测CListCtrl选择更改? - 堆栈溢出 [ ^ ]

I have a list control on my dialog-box which contain list of names. when one particular name is selcted then display it in editbox control. How to do this in mfc? better if provide one simple code example.

解决方案

This CodeProject article provides comprehensive overview: Using the CListBox control[^].

Pay attention for the notification message LBN_SELCHANGE in the section "Handling CListBox Messages".

Please see: LBN_SELCHANGE notification code (Windows)[^].

As to the edit box, you can use the class CEdit. Using is the way you probably does not need additional explanations: CEdit Class[^].

Basically, this is all you need to know.

Good luck.
—SA


Are you using CListCtrl? if Yes see visual c++ - How to detect a CListCtrl selection change? - Stack Overflow[^]


这篇关于从列表控件中选择项目并在mfc vc ++中显示到编辑框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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