如何在MFC中为动态创建的按钮创建事件? [英] How to create an event for Dynamically created Buttons in MFC?

查看:609
本文介绍了如何在MFC中为动态创建的按钮创建事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是MFC编程的新手,我在CpropertySheet中添加了2个属性页.通常,在Cproperty工作表中,它具有默认按钮"HELP BACK NEXT".我隐藏了帮助按钮,并动态创建了另一个按钮并将其命名为具有完成" ..现在我必须向其添加按钮单击事件.有人知道该怎么做吗?请帮我!

Hello i am new to MFC programming,I have a CpropertySheet in which i have added 2 Property Pages.Normally in Cproperty sheet it has default buttons "HELP BACK NEXT " I have hidden help button and created another button dynamically and named it has "Finish" .. now i have to add a button click event to it.Do anybody know how to do that?plz help me!

推荐答案

我问过你如果您不能仅使用帮助按钮的处理程序并将其重命名为完成"?!您是否读完了我指向您的文章?这样的事情在那篇文章中完成了!

PS:请不要在这里使用SMS术语.
I asked you if you can''t just use the handler of help button and rename it to Finish?! Did you read through the article I pointed you at? Things like that are done in that article!

PS: Please do not use SMS lingo here.


您真的需要动态创建控件吗?!

为什么不能简单地将帮助按钮重命名为完成"并取消该按钮的处理程序?

另外,请看一下这篇文章:破解CPropertySheet [
Do you really need to create controls dynamically?!

Why can''t you simply rename the help button to "Finish" and do away with the handler of that button?

Also, take a look at this article: Hacking the CPropertySheet[^]


感谢Rajesh.我在CPropertySheet中所做的工作,您不能只是直接添加按钮(就像您在对话框中所做的那样)..应该动态创建它.
Thanks Rajesh. What I am working in CPropertySheet, youu can''t just add buttons directly (Like what you do in dialog box)..it should be created dynamically.


这篇关于如何在MFC中为动态创建的按钮创建事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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