In main code:
I know, ES_AUTOSCROLL doesn't work with the listbox... but I had to try!
In the dialog's callback:
As lines are added and fill the box, the Vertical scrollbar appears (as desired).
I'd like the text to scroll so that the last line added is displayed as the last line in the box. This will scroll the rest "upward"...
Although I've read SDK and Help info, searched the fourm, and tried various values, I'm presuming there's something in the LB_SETCURSEL message that I haven't found yet.
Can anyone provide me a pointer to relevant information?
Thanks!
Code:
ListboxFlags = %ws_child Or %ws_visible Or %ws_tabstop Or %ws_vscroll Or %lbs_multiplesel Or %lbs_extendedsel 'ListboxFlags = ListboxFlags Or %es_autovscroll ' Or %lbs_disablenoscroll Control Add ListBox, hDlg, %LISTBOX, , 5, 5, 490, 50, ListboxFlags, %ws_ex_clientedge
In the dialog's callback:
Code:
ListboxCount = SendMessage(hList, %LB_GETCOUNT, 0, 0) 'Ask listbox for items count SendMessage(hList, %LB_ADDSTRING, ListboxCount, StrPtr(sBuffer)) 'Add message to listbox SendMessage hList, %LB_SETCURSEL, ListboxCount, 0 'Go to last listbox position
I'd like the text to scroll so that the last line added is displayed as the last line in the box. This will scroll the rest "upward"...
Although I've read SDK and Help info, searched the fourm, and tried various values, I'm presuming there's something in the LB_SETCURSEL message that I haven't found yet.
Can anyone provide me a pointer to relevant information?
Thanks!
Comment