事件处理程序行为 [英] Event handler behavior

查看:145
本文介绍了事件处理程序行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我选择DropDown类型组合框的元素,则除非再次选择该元素,否则不会调用ON_CBN_CLOSEUP()事件处理程序.但是,当我更改为DropDownList类型时,第一次选择元素时会调用ON_CBN_CLOSEUP()事件处理程序.有人知道为什么吗?

If I choose an element of the DropDown type combo box, the ON_CBN_CLOSEUP() event handler is NOT called unless I select the element again. But when I change to DropDownList type, the ON_CBN_CLOSEUP() event handler is called the first time I select an element. Does anyone know why?

推荐答案

根据MSDN(
According to MSDN (reference), the ON_CBN_CLOSEUP message is not sent for a combo box that has the CBS_SIMPLE style. I think that is your problem. If you are using this setup on the combo box, then just use the ON_CBN_SELCHANGE event and you should get the event you need, that is unless you have a different reason for not using this one in the first place.


这篇关于事件处理程序行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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