IonicWind Software

IWBasic => General Questions => Topic started by: plurald on January 10, 2011, 04:51:12 PM

Title: Can't make a list box work
Post by: plurald on January 10, 2011, 04:51:12 PM
Hi,

Haven't done a list box before so I'm having a bit of a problem.  I've set up a listbox in a MDI window using this CONTROL command:
       CONTROL(listboxMDI,@LISTBOX|@CTLISTNOTIFY,"Choose User Name",30,50,70,60,0x50800140,99). 
I populate it using an ADDSTRING command.

In the handle subroutine for this window I have this code:
SELECT @CLASS
   CASE @IDCONTROL
      IF @NOTIFYCODE = 0
         SELECT @CONTROLID
            CASE 0
               Username = GETSTRING(listboxMDI,99,0)
            CASE 1
               Username = GETSTRING(listboxMDI,99,1)
         ENDSELECT
      ENDIF
ENDSELECT

The listbox display's nicely in the window and contains the expected two list entries.  However, Username in the CASE statements above does not get filled when I double-click on an entry.  I added PRINT statements in the CASE statements but they don't show up so I'm assuming this code is not getting executed.

Two questions: 
What's wrong with the above code?


Title: Re: Can't make a list box work
Post by: plurald on January 10, 2011, 04:56:24 PM
Please ignore this thread.  There's a bit more info in the thread preceding this one.