Announcement

Collapse
No announcement yet.

Getting selection from a Listbox

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

  • Dave Stanton
    replied
    Wyman,
    You are, of course, quite right.
    I've been looking at the code for the last few hours, and I
    couldn't see the wood for the trees.
    Thanks for the reality check,
    Dave

    ------------------

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Don't you need to use LISTBOX GET TEXT hDlg&, id& TO text$ ???


    ------------------
    [email protected]

    Leave a comment:


  • Dave Stanton
    started a topic Getting selection from a Listbox

    Getting selection from a Listbox

    I hope someone can help with suggestions for this one.


    I'm creating a listbox with the symbols of all of the elements which works well, however
    when trying to retrieve the selected string all I get is a null string
    To debug this I'm using a Msgbox, normally it goes into a string array.

    Dave Stanton

    Code:
    ...........................
    
      CONTROL ADD LISTBOX ,ghDlg, %ID_Grid0, A(),150,10,60,50,%LBS_NOTIFY OR _
                                 %WS_VSCROLL OR %WS_BORDER  CALL AtomCallBack 
    
    ............................
    
      CALLBACK FUNCTION AtomCallBack()
           LOCAL B$
           
                 IF CBCTLMSG = %LBN_SELCHANGE THEN
                    
                    CONTROL GET TEXT ghDlg,%ID_Grid0 TO B$
                    
                    MSGBOX B$,,"Element"
    
                 END IF
       END FUNCTION
    ------------------
Working...
X