PowerBasic 相關文件及程式庫 > PowerBASIC 範例及函式庫

ComboBox 相關的程序函數庫

(1/1)

admin:

--- Code: ---
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


--- End code ---

Navigation

[0] Message Index

Go to full version