Author Topic: 字串陣列灌入 Combobox / Popupmenu 的函數  (Read 4099 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
字串陣列灌入 Combobox / Popupmenu 的函數
« on: August 23, 2011, 07:50:23 PM »
Code: [Select]
Sub ControlAddRowbyAry(tmpControl As object, tmpArray(,) As string, Optional PosX As Integer = 1)
  Dim inty As integer
  select case tmpcontrol
  case isa ComboBox
    combobox(tmpControl).DeleteAllRows
    For intY = 0 To UBound(tmpArray, 2)
      combobox(tmpcontrol).addrow tmpArray(0, intY)
      combobox(tmpControl).RowTag(combobox(tmpControl).listcount-1)= tmpArray(PosX, intY) 
    Next
   
  case isa popupmenu
    popupmenu(tmpControl).DeleteAllRows
    For intY = 0 To UBound(tmpArray, 2)
      popupmenu(tmpcontrol).addrow tmpArray(0, intY)
      popupmenu(tmpControl).RowTag(popupmenu(tmpControl).listcount-1)= tmpArray(PosX, intY)
    Next
  end select
 
End Sub
« Last Edit: January 06, 2012, 03:06:56 AM by Roy Chan »