且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在mfc中为动态创建的静态控件添加事件处理程序

更新时间:2023-10-12 19:09:34

在创建静态控件以启用通知时,必须使用 SS_NOTIFY 样式。然后父窗口将获得 STN\_CLICKED通知代码| Microsoft Docs [ ^ ]。



在消息地图中,您可以使用 STN_CLICKED BN_CLICKED 因为它们具有相同的值。
You have to use the SS_NOTIFY style when creating the static controls to enable notifications. Then the parent window will get a STN\_CLICKED notification code | Microsoft Docs[^].

In the message map you can use STN_CLICKED or BN_CLICKED because they have the same value.