如何使用普通C在工具箱中创建自定义控件,以便我可以将其拖入对话框窗体 [英] How do I create a custom control in the toolbox with plain C so that I can drag in to the dialog form
问题描述
我正在尝试开发一个可以在visual studio的工具箱上显示的控件,以便我可以将控件拖到我的对话框资源的窗体视图中。到目前为止我只能找到C#的例子,到目前为止,互联网上还没有一个简单的例子,我相信其他人必须有类似的要求,有没有人设法做到这一点并且愿意分享他的知识? br $> b $ b
我尝试了什么:
我可以在我的网站中创建自定义控件程序,但我必须使用CreateWindow在formview上创建我的控件,而不是直接将控件拖到FormView,所以我不能在运行程序之前预先查看我的Formview。
I am trying to develop a control which can show itself on the Tool box of visual studio so that I can drag the control to the Form View of my dialog resource. I can only find C# examples so far, no plain c example on the internet is found available so far, I believe there must be similar requirements from other people, has any one managed to do this and be willing to share his know how?
What I have tried:
I can create custom control in my program, but I have to use CreateWindow to create my control on the formview rather than directly drag the control to the FormView, so I can not prearrange the looking of my Formview before running the program.
推荐答案
你不能:plain C没有任何Object的概念,你需要一个对象来将一个控件加载到工具箱中。你需要C ++或C#包装器才能做到这一点。
You can't: plain C doesn't have any concept of Objects, and you need an object to load a control into the toolbox. You would need C++ or a C# wrapper to do that.
这篇关于如何使用普通C在工具箱中创建自定义控件,以便我可以将其拖入对话框窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!