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


          'AUTOHOTKEY' 카테고리의 다른 글

          IniRead, IniWrite, IniDelete  (0) 2019.02.20
          Line number in listbox  (0) 2019.02.20
          ControlGet 에 관한 고찰  (0) 2019.02.20
          GetText from ListBox  (0) 2019.02.20
          ControlGet  (0) 2019.02.20

          + Recent posts