Announcement

Collapse
No announcement yet.

PB9 Combobox

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

  • PB9 Combobox

    It appears that the control add combobox statement in PB9 is broken.

    Code:
    #COMPILE EXE
    DEFLNG A - Z
    
    FUNCTION PBMAIN () AS LONG
    
    LOCAL Itm() AS STRING
    DIM Itm$(1 TO 10)
    
    FOR I = 1 TO 10
      Itm$(I) = FORMAT$(I)
      A$ = A$ + Itm$(I)
    NEXT I
    
    
    Styl = %WS_OVERLAPPEDWINDOW
    DIALOG NEW  0, "Test", , , 100, 100, Styl, ,  TO hDlg
    
    'CONTROL ADD GRAPHIC, hdlg, 100, "", 0, 0, 100, 100'
    'GRAPHIC ATTACH hdlg, 100
    'GRAPHIC CLEAR %GREEN
    
    
    CONTROL ADD COMBOBOX, hdlg, 200, Itm$(), 20, 20, 40, 30
    DIALOG SHOW MODAL hdlg CALL tstCB
    
        
    
    END FUNCTION
    
    CALLBACK FUNCTION tstCB
    END FUNCTION
    The combobox should have 10 items. It only has one.
    Walt Decker

  • #2
    Hi Walt,

    The Combobox is working correctly. What occurred is that you did not tell the combobox to put a scrollbar on the drop down box if the box is not long enough to list all the strings, this is done with the %WS_VSCROLL style. Also your drop down box is only 30 dialog units in height. I would add the %WS_VSCROLL style and increase the height of the drop down box.

    Code:
    Control Add ComboBox, hdlg, 200, Itm$(), 20, 20, 40, 100, %WS_Child Or %WS_TabStop Or %WS_VScroll Or %CBS_DropDown
    Sincerely,

    Steve Rossell
    PowerBASIC Staff

    Comment


    • #3
      Once again I'm an alumni of DUH.
      Walt Decker

      Comment


      • #4
        >an alumni of DUH.

        Oooh, oooh... the University of :doh:

        I like it. I shall use it.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Originally posted by Michael Mattias View Post
          >an alumni of DUH.

          Oooh, oooh... the University of :doh:

          I like it. I shall use it.
          Michael, be my guest. I first heard that on talk radio, Rush Limbaugh (sp) to be exact, and have used it since.
          Walt Decker

          Comment

          Working...
          X