Author Topic: 以主鍵值找尋Combobox/Popupmenu相對位置  (Read 4321 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
以主鍵值找尋Combobox/Popupmenu相對位置
« on: August 23, 2011, 07:55:50 PM »
Code: [Select]
Sub ShowListbyRowTag(tmpControl As object, tmpKeyValue as string)
  Dim inty As integer
  select case tmpcontrol
  case isa ComboBox
    For intY = 0 To combobox(tmpControl).listcount -1
      if combobox(tmpControl).RowTag(inty).StringValue= tmpKeyValue  then
        combobox(tmpControl).listindex=inty
        exit sub
      end if
    Next
    combobox(tmpControl).listindex=-1
   
  case isa popupmenu
    For intY = 0 To popupmenu(tmpcontrol).listcount -1
      if popupmenu(tmpControl).RowTag(inty).stringvalue= tmpKeyValue then
        popupmenu(tmpControl).listindex=inty
        exit sub
      end if
    Next
    popupmenu(tmpControl).listindex=-1
   
  end select
 
End Sub
« Last Edit: October 23, 2011, 01:45:45 AM by Roy Chan »