在MFC的停靠窗格中使用控件(按钮,滑块等) [英] using controls (buttons, sliders, etc) in a docking pane in MFC

查看:75
本文介绍了在MFC的停靠窗格中使用控件(按钮,滑块等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在我的应用程序中添加一个停靠窗格(CDockablePane),其中包含几个MFC控件,例如滑块,测试编辑,按钮,滚动条以及可以在其中绘制的通用区域.

整个事情也需要一个垂直滚动的列表.列表中的每一列都是相同的,一个滑块,一个文本编辑和一个按钮,但是列表的长度在运行时是可变的.

我需要以编程方式生成控件列表,即不使用产生固定布局的对话框编辑器


有人可以在我可以从中获得一些想法或一些示例代码的地方推荐示例示例吗?

谢谢,史蒂夫

解决方案

没有依赖,但我确实找到了两个有趣的项目,我想与他人分享,以防其他任何人也做同样的事情. >
XListCtrl-具有子项目格式的自定义绘制列表控件
XListCtrl-具有子项格式的自定义绘制列表控件 [ ^ ]

这看起来非常强大,而且很难理解,使用或构建.

列表控件扩展为进度控制
[ class MyDockPane:CDockablePane { // 其他声明 受保护的: CFormView m_wndFormView; // 更多声明 };


hi
i want to add a docking pane (CDockablePane) to my app that contains several MFC controls like sliders, test edits, buttons, scroll bars, and a general purpose area i can draw in

the whole thing needs a list with a vertical scroll too. each column in the list is the same, a slider, a text edit and a button, but the length of the list is variable at run time.

i need to generate the list of controls programmatically, i.e. not using a dialog editor which produce a fixed layout


can someone suggest a sample example somewhere that i could get some ideas from or a bit of sample code?

thanks, steve

no relies but i did find a couple of interesting projects i''d like to share incase any one else is doing the same.

XListCtrl - A custom-draw list control with subitem formatting
XListCtrl - A custom-draw list control with subitem formatting[^]

this looks very powerful and very complex to understand and use, or build.

List Control Extended for Progress Control
[^]

this is super simple to understand, build and modify and it looks like you can easily use any control in the list control


I''m not sure, but maybe you could add a scroll-view on your dockable pane. Otherwise you could also add a CFormView on your pane. You can do it like this:

class MyDockPane : CDockablePane
{
//Other declarations
protected:
CFormView m_wndFormView;
//More declarations
};


这篇关于在MFC的停靠窗格中使用控件(按钮,滑块等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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