是否可以使用 CListCtrl 就地编辑数据 - 如果不能,任何人都可以建议 MFC 中的替代控件吗?

发布于 2024-08-25 00:40:28 字数 160 浏览 1 评论 0原文

我正在设计一个 MFC 应用程序,其中我希望有一个包含 2 列的网格:两者均可编辑,用户将在其中输入数据,并且应用程序将收到有关它的通知。用户可以根据需要增加/减少行数 - 对于这种需求,理想的 MFC 控件是什么?

这是我第一次设计 MFC 应用程序,所以如果听起来太菜鸟,请不要介意:)

I'm designing a MFC app in which I'd like to have a grid with 2 coloumns : both editable in which the user will input data and the app will get notified about it. The number of rows can be increased/decreased by the user as he wants - What would be the ideal MFC control to use for this kind of requirement ?

This is my first time designing a MFC app , so dont mind if it sounds too noobish :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独孤求败 2024-09-01 00:40:28

这不是一个新手问题。实际上,您已经遇到了一个困扰每个 MFC 开发人员 15 年来的问题:MFC 库没有内置的网格控件。我想,您正在寻找一种网格控制。据我所知,不可能在 CListCtrl 中编辑两列。仅第一列“标签”可以编辑。

对于网格控件,您必须寻找可以添加到您的项目中的适当的第三方工具,例如 ActiveX 控件。 (我记得旧的 Visual Studio 6 附带了一个“MS FlexGrid”,您可以将其与组件库一起添加到项目中,但我从未使用过它,所以我不知道它是否是一个不错的选择。但是也许足以满足您的目的。)大多数第三方网格控件都需要许可费,但这里有一个(相当强大的)免费网格(至少免费,但没有许可证):

http://www.codeproject.com/KB/miscctrl/gridctrl.aspx

(或通过“MFC Grid Control”进行谷歌搜索)或者类似的东西,我认为会有更多的免费网格。)

It's not a noobish question. Actually you have encountered a problem which bugs every MFC developer since 15 years: The MFC library does not have a built-in Grid Control. And a kind of Grid Control is what you are looking for, I guess. As far as I'm aware of, it is not possible to edit two columns in a CListCtrl. Only the first column, the "Label", can be edited.

For a Grid control you have to look for appropriate Third-Party tools which can be added to your projects, for instance as ActiveX controls. (I remember that the old Visual Studio 6 came with an "MS FlexGrid" which you could add with the component gallery to the project, but I've never worked with it, so I don't know if it's a good choice. But perhaps enough for your purpose.) Most third-party Grid controls require license fees but here is one (quite powerful) grid for free (at least free of fees but not of a license):

http://www.codeproject.com/KB/miscctrl/gridctrl.aspx

(or google by "MFC Grid Control" or something like that. I think there will be more free grids.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文