我想实现单击listbox中的某一行,选中行就显示在edit框中,但是当我按住SHIFT或者是ctrl的时候,我可以把选中的多个行显示在edit框中,我想过用lbn_selchange事件可是,不行啊,请高手指点下,小弟这里先谢过了。

解决方案 »

  1.   

    你listbox的单击事件中, 根据GetSelectionItem枚举就可以了.
      

  2.   

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

  3.   

    我的问题可能有点模糊,我做CAD二次开发的,我先获得图层名字,显示在listbox里。(这些图层里的图都是同时显示在CAD上的)当我单击某个图层名的时候,CAD就只显示那一个图层的图,其他的不显示,当我多选的时候,就显示多个。问题是,我按住SHIFT,或者CTRL的时候,它还是只显示我最后选择的那个图层,我用的是selchanged事件。问题清楚不?
      

  4.   

    不会的, 如果是ctlr或者shift多选, 也可以遍历到的.