Author Topic: ComboBox 相關的程序函數庫  (Read 3467 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
ComboBox 相關的程序函數庫
« on: November 11, 2011, 01:26:37 PM »
Code: [Select]

Sub ComboAddRowbyAry(hWndControl As Dword, tmpArray() As String, StartRow As Integer,ByVal ItemDataPos As Integer, ByVal ItemStringPos As Integer)
    Local intY As Integer
    Local tmpIndex As Long
   
    FF_ComboBox_ResetContent(hWndControl )
    For inty=startrow To UBound(tmparray,2)
       tmpindex=FF_ComboBox_AddString( hWndControl, tmparray(itemstringpos,inty))
       FF_ComboBox_SetItemData (hWndControl, tmpindex,CvL(tmparray(itemdatapos,inty)))
    Next

End Sub


'--------------------------------------------------------------------------------

Sub ShowCombobyItem(hWndControl As Dword, tmpKeyValue As Long)
  Local intY As Integer
  Local ListCount As Long
  Local tmpItemData As Long
 
  'ztrace Str$(tmpKeyValue)
  listcount=FF_ComboBox_GetCount( hWndControl)
 
  If listcount >0 Then
    For inty=0 To listcount
      tmpitemdata=FF_ComboBox_GetItemData( hWndControl, intY )
      If tmpitemdata=tmpkeyvalue Then     
        FF_ComboBox_SetCurSel( hWndControl, inty )
        Exit Sub
      End If
   
    Next
  End If
   
End Sub


'--------------------------------------------------------------------------------

Sub ShowCombobyText(hWndControl As Dword, tmpTextValue As String)
  Local tmpResult As Long

  tmpresult=FF_ComboBox_FindString( hWndControl, -1, tmpTextValue)
  'ztrace Str$(tmpresult)
  FF_ComboBox_SetCurSel( hWndControl, tmpresult )
 
End Sub

« Last Edit: November 14, 2011, 08:53:18 PM by Roy Chan »