Guidance
指路人
g.yi.org
software / rapidq / examples / gui / listbox & ComboBox / multi / multi.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' How to use a multiselected ListBox in Rapid-Q by William Yu
' All you really have to do is set MultiSelect to True, and then check
' the array of Selected items.

     CONST False = 0
     CONST True = NOT False

     DECLARE SUB ButtonClick

     CREATE Form AS QFORM
      Height = 290
      Width = 350
      CAPTION = "Multi-Select ListBox"
      Center
      CREATE ListBox1 AS QLISTBOX
       MultiSelect = True
       Width = 150
       Height = 200
       AddItems "Item 1", "Item 2", "Item 3", "Item 4", _
        "Item 5", "Item 6", "Item 7", "Item 8", "Item 9"
      END CREATE
      CREATE ListBox2 AS QLISTBOX
       Left = 190
       Width = 150
       Height = 200
      END CREATE
      CREATE Button AS QCOOLBTN
       Left = 155
       Top = 50
       Width = 30
       CAPTION = ">"
       OnClick = ButtonClick
      END CREATE
      CREATE Label AS QLABEL
       Left = 10
       Top = 220
       CAPTION = "To multiselect individual items, " + _
        "just hold down the CTRL key" + CHR$(13) + _
        "while pressing the mouse button."
      END CREATE
      SHOWMODAL
     END CREATE


     SUB ButtonClick
      ListBox2.Clear
      FOR I = 0 TO ListBox1.ItemCount-1
       IF ListBox1.Selected(I) THEN          '' Add only the selected items
        ListBox2.AddItems ListBox1.Item(I)
       END IF
      NEXT
     END SUB
掌柜推荐
 
 
¥900.00 ·
 
 
¥430.00 ·
 
 
¥1,580.00 ·
 
 
¥1,015.00 ·
 
 
¥750.00 ·
 
 
¥890.00 编辑
© Mon 2024-11-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:1999-09-27 19:44:28