0
如何過濾鍵入DBLookupComboBox,並搜索包含在該項目的任何位置的單詞,類似於jquery select2。DBLookupComboBox - 如何通過鍵入類似的select2來過濾jquery
如何過濾鍵入DBLookupComboBox,並搜索包含在該項目的任何位置的單詞,類似於jquery select2。DBLookupComboBox - 如何通過鍵入類似的select2來過濾jquery
不能鍵入在DBLookupComboBox
,但你可以用TEdit
和TPanel
使用它。
TPanel
。TPanel
上放置TDBLookupComboBox
和TEdit
,並將它們的Align
的性質設置爲alClient
。procedure
。TEdit
的AlignWithMargins
屬性設置爲True
。Top, Buttom, Right
爲0,並設置Right
〜20使用procedure
用於過濾器。
Procedure filterr(Dataset: TDataSet; const FieldName, SearchTerm: string);
begin
Assert(Assigned(Dataset), 'No dataset is assigned');
if SearchTerm = '' then
Dataset.Filtered := False
else
begin
Dataset.Filter := FieldName + ' LIKE ' + QuotedStr(SearchTerm + '*');
Dataset.Filtered := True;
end;
end;
在OnChange
事件的TEdit
filterr(mytable;'fieldname';edit1.Text);
謝謝你正是我需要的。 值得懷疑:DBLookupComboBox和Edit組件沒有alignment屬性。 –