DataGridView VS2008 MFC [英] DataGridView VS2008 MFC

查看:264
本文介绍了DataGridView VS2008 MFC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的VS2008 MFC应用程序,需要向其中添加用户功能.最干净的方法是使用某种DataGrid形式.由于DataGridView控件不在工具箱中,因此我尝试了以下Microsoft方法:
http://msdn.microsoft.com/en-us/library/b1kyh79x.aspx

文章说我应该选择WindowsFormsControlLibrary1作为参考.但是,当我单击项目"选项卡时,那里什么都没有.我搜索了硬盘驱动器,但WindowsFormsControlLibrary1.dll文件不在我的计算机上.

我需要的是一个简单的5 col X 20行表格,供用户输入数据.有没有其他方法可以做到这一点?还是将DataGrid控件放入我的MFC应用程序中的任何方法?

Ray

I have an existing VS2008 MFC application that I need to add user functionality to. The cleanest way to do this is with a DataGrid form of some sort. Since the DataGridView control is not in the toolbox I tried this Microsoft method:
http://msdn.microsoft.com/en-us/library/b1kyh79x.aspx

The article says I should select WindowsFormsControlLibrary1 for the reference. However, when I click on the Projects tab there is nothing there. I searched the hard drive and the WindowsFormsControlLibrary1.dll file is not on my machine.

All I need is a simple 5 col X 20 row form for the user to enter data. Are there any alternative ways to accomplish this? Or any way to get the DataGrid control into my MFC application?

Ray

推荐答案

本文还说,您必须首先创建WindowsFormsControlLibrary1.dll.如果找不到dll,则表示您没有遵循创建.NET用户控件"的第一步.一切都解释得很好-只需按照说明进行操作即可.
The article also says, that you must create the WindowsFormsControlLibrary1.dll as first step. If you can''t find the dll then this means you didn''t follow the first steps "To create the .NET user control". It is all very good explained - just follow the instructions step by step.


JF2015,

感谢您的输入.我完全忽略了.NET进程.当我看到我的想法说我正在使用MFC时. :sigh:

因此,我遵循了.NET程序.它创建了WindowsFormsControlLibrary1.dll.然后,我按照MFC的步骤进行操作.但是我仍然看不到项目"选项卡下面的任何内容.我在参考搜索路径"窗口中将路径添加到了dll.

所以我越来越近了,但仍然不在那儿.

另一个问题:完成这项工作后,我的项目仍将使用其中的所有MFC代码进行编译吗?

谢谢.
JF2015,

Thanks for the input. I had completely ignored the .NET process. When I saw that my mind said I''m working with MFC. :sigh:

So I followed the .NET procedure. It created the WindowsFormsControlLibrary1.dll. I then followed the MFC steps. But I still do not see anything underneath the Projects tab. I added the path to the dll in the Reference Search Path window.

So I am getting closer but still not there.

One other question: Once I get this working will my project still compile with all the MFC code in it?

Thanks.


几年前,我有一篇文章介绍了如何将MenuStrip/ToolStrip 控件添加到MFC应用程序中:

http://www.codeproject.com/KB/miscctrl/MfcWinFormsOff.aspx [ ^ ]

相同的技术也应该在DataGridView中起作用.
I have an article from a few years back that shows how you can add the MenuStrip/ToolStrip controls to an MFC app :

http://www.codeproject.com/KB/miscctrl/MfcWinFormsOff.aspx[^]

The same techniques should work a DataGridView too.


这篇关于DataGridView VS2008 MFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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