Jump to content

Select the last item in a listbox


sandyd
 Share

Recommended Posts

Hi Peeps,

I have been trying this for the past hour and getting nowhere.

I have been using CyberSlug's listbox_wrappers include file but just cannot seem to get itto work.

Can anyone offera snippet of code that does the job?

TIA

----[ SandyD ]---
Link to comment
Share on other sites

I have not wrapper under my hand, so this is code with msg using. You need get items count first and then set selection to the last item.

GUICreate("Test")
$hList = GUICtrlCreateList("", 5, 5)
GUICtrlSetData(-1, "Row1|Row2|Row3|Row4|Row5")
GUISetState()

$LB_GETCOUNT = 0x018B
$LB_SETCURSEL = 0x0186

$count = GUICtrlSendMsg($hList, $LB_GETCOUNT, 0, 0)
GUICtrlSendMsg($hList, $LB_SETCURSEL, $count - 1, 0)

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = -3 Then Exit
Wend
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...