May 18, 2024, 06:51:06 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Can't make a list box work

Started by plurald, January 10, 2011, 04:51:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

plurald

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?



plurald

Please ignore this thread.  There's a bit more info in the thread preceding this one.