我创建一个隐藏的listbox,当一个编辑框获得输入焦点时显示该listbox,发现listbox不能响应消息。

解决方案 »

  1.   

    就是比如你选择其中一个项,不会进到我的selchange消息处理函数里面
      

  2.   

    This message is sent by an application when the selection in a list box is about to change. The parent window of the list box receives this message through the WM_COMMAND message. 
    你的ListBox控件的父窗口是哪个?
      

  3.   

    This message is not sent if the LB_SETCURSEL message changes the selection. This message applies only to a list box that has the LBS_NOTIFY style. For a multiple-selection list box, the LBN_SELCHANGE message is sent whenever the user presses an arrow key, even if the selection does not change. 
      

  4.   

    就是在主窗口窗口中啊,mfc创建的基于窗口的工程,
      

  5.   

    其实我发现,如果一开始就显示的话,可以响应消息,但是一旦先用showwindow函数隐藏listbox过后,再用showwindow函数显示listbox就无法响应消息了
      

  6.   

    EnableWindow(TRUE);