如何在基于MFC多文档的应用程序中添加复选框 [英] How to add check boxes in MFC multiple document based application

查看:211
本文介绍了如何在基于MFC多文档的应用程序中添加复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我正在使用MS Visual Studio 2010使用visual studio样式构建基于MFC多文档的应用程序。



我想在输出区域添加一些复选框。有人请指导我如何在那里添加复选框。在基于对话框的MFC应用程序中,我们可以通过工具箱轻松完成,但我发现没有运气。



谢谢



我尝试过:



我正在使用MS Visual Studio:我想在此函数中添加复选框,

 oid COutputWnd :: FillBuildWindow()
{
m_wndOutputBuild.AddString(_T(此处显示构建输出。));

}

解决方案

基于MFC文档的应用程序使用 CView 派生类来显示文档。您通常可以从 MFC中可用的派生视图类中获取自己的类[ ^ ]或根据<$创建自己的一个c $ c> CView 。



如果您需要带有复选框等控件的视图,表单视图(MFC) [ ^ ]可能是最好的基类。


你能通过代码片段给我看一个例子吗? />
喜欢

 CButton myButton; 
myButton.Create(_T(我的按钮),WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
CRect(10,10,100,30),& m_wndOutputBuild,4);


Hello!
I am using MS Visual Studio 2010 to build a MFC Multiple Document based application using visual studio style.

I want to add some checkboxes in output area. Anybody please guide me that how to add checkboxes there. In dialog based MFC application, we can easily do that via toolbox but I found no luck in my case.

Thanks

What I have tried:

I am using MS Visual Studio: I want to add checkboxes in this function,

oid COutputWnd::FillBuildWindow()
{
	m_wndOutputBuild.AddString(_T("Build output is being displayed here."));
	
}

解决方案

MFC document based applications use CView derived classes to display documents. You will typically derive your own class from one of the Derived View Classes Available in MFC[^] or create your own one based on CView.

If you need a view with controls like check boxes, Form Views (MFC)[^] might be the best base classes.


Can you please show me an example via code snippets ?
like

CButton myButton;
	myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, 
   CRect(10,10,100,30), &m_wndOutputBuild, 4);


这篇关于如何在基于MFC多文档的应用程序中添加复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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