AUTOHOTKEY

ListBox Count

remoted 2019. 2. 20. 00:37
728x90
BradleyS
  • Members
  • 220 posts
      •  Last active: Mar 05 2016 10:45 PM
      • Joined: 20 Sep 2005
      I'm trying to get a count of the amount of items in a listbox.

      It seems as thought the code below should do the trick, but it just shows me the list of items, not the count.
      Gui, Add, ListBox, vColorChoice, Red|Green|Blue|Black|White
      Gui, Show,,ListBox
      
      ControlGet, List, List, [color=red]Count [/color],ListBox1, A
      
      MsgBox, %List%
      ExitApp
      
      ^esc::exitapp

      How do I get a total count of items in a listbox? 


      Solar
      • Members
      • 345 posts
          •  Last active: Jan 15 2012 08:11 PM
          • Joined: 03 May 2009
          Gui, Add, ListBox, vColorChoice HWNDhLB, Red|Green|Blue|Black|White
          
          Gui, Show,,ListBox
          
          
          
          LBCount := DllCall("SendMessage", "uint", hLB, "uint", 0x18B) ; LB_GETCOUNT
          
          
          
          MsgBox %LBCount%
          
          return
          
          
          
          ^esc::exitapp