CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Getting list of selected items from a list control

    Hi,
    I want to get a list of selected items from a listcontrol.
    How do i get it?

    Also How do I trap the SHIFT key press and the left button click together.
    Please help me out of this.
    Thanks




  2. #2
    Guest

    Re: Getting list of selected items from a list control

    To know the items selected in a list you can use the methods GetSelectedCount, GetFirstSelectedItemPosition and GetNextSelectedItem methods of the CListCtrl objects.
    If you can not do this then you have to verify the state of each item of the list.

    Concerning the shift key and the left click first catch the message WM_LBUTTONDOWN and use the function GetKeyState to see if shift is pressed.

    For example :

    (GetKeyState(VK_SHIFT) & ~1) is non zero if shift is pressed.





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured