Author Topic: 以顯示內容找尋Combobox/Popupmenu相對位置  (Read 4587 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
以顯示內容找尋Combobox/Popupmenu相對位置
« on: August 23, 2011, 07:56:33 PM »
Code: [Select]
Sub ShowListbyText(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 lowercase(combobox(tmpControl).list(inty))= lowercase(tmpKeyValue)  then
        combobox(tmpControl).listindex=inty
        exit for
      end if
    Next
   
  case isa clsComboBox
    For intY = 0 To clscombobox(tmpControl).listcount -1
      if lowercase(clscombobox(tmpControl).list(inty))= lowercase(tmpKeyValue)  then
        clscombobox(tmpControl).listindex=inty
        exit for
      end if
    Next
   
  case isa popupmenu
    For intY = 0 To popupmenu(tmpcontrol).listcount -1
      if lowercase( popupmenu(tmpControl).list(inty))= lowercase(tmpKeyValue )then
        popupmenu(tmpControl).listindex=inty
        exit for
      end if
    Next
   
  case isa clsPopupMenu
    For intY = 0 To clspopupmenu(tmpcontrol).listcount -1
      if lowercase( clspopupmenu(tmpControl).list(inty))= lowercase(tmpKeyValue )then
        clspopupmenu(tmpControl).listindex=inty
        exit for
      end if
    Next
   
  end select
 
End Sub
« Last Edit: October 23, 2011, 01:45:11 AM by Roy Chan »