Announcement

Collapse
No announcement yet.

preset selection in multiple select listbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • John Tate
    replied
    Thanks, Kev.
    I did not read far enough in the win32hlp file. I was looking at the LB_?? list, but did not see that LB_SETSEL was for multiple select listboxes.
    Once I had the
    CONTROL SEND CBHNDL,%IDC_LISTBOX2, %LB_SETSEL&,INDEX , I can have any item in the listbox selected when it is displayed. Index is zero based.

    I am listing invoices by invoice number and by date, starting with the smallest invoice number and earliest date. As the listbox is filled, the invoice balance and total customer balance is calculated and displayed. My customer wanted a statement the showed a 10% increase in customer balance if it was over 90 days. Since the most recent invoices will be the ones in question, I can have the list displayed with the most recent invoices displayed on the screen, because the last invoice record will be selected.

    I need to study the win32hlp file some more, and test some of those things!

    Thanks again,

    John Tate

    Leave a comment:


  • Kev Peel
    replied
    Have you tried LB_SETSEL? It can be used to select items in a multi-select listbox.

    Note: it is not the same as LB_SETCURSEL, which is used to select and highlight only a single item.

    Leave a comment:


  • John Tate
    started a topic preset selection in multiple select listbox

    preset selection in multiple select listbox

    What is the correct syntax for %LB_SETANCHORINDEX AND
    %LB_SETCARETINDEX?
    I have tried:
    control send CBHNDL, %IDC_LISTBOX2, INDEXNUM,0
    control send CBHNDL, %IDC_LISTBOX2, INDEXNUM, 1,
    which should show an item selected in my listbox.
    I want to preselect one or more items in a multiple select listbox.

    Any ideas?

    Thanks,

    John Tate
Working...
X