Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with TDBEditEh(Sender) do
- begin
- if (Length(Trim(Text)) <= 3) then
- begin
- MRUList.CloseUp(True); //схлопываем MRU-лист
- MRUList.Active := False; //отключаем MRU-лист
- Exit; //уходим, т.к. не из чего выбирать или потенциально слишком большой выбор
- end;
- end;
- with TDBEditEh(Sender) do
- begin
- MRUList.Items.Clear; //чистим MRU-лист
- MRUList.Rows := 10; //показываем только 10 строк
- MRUList.Active:= True; //включаем MRU-лист
- MRUList.DroppedDown:= True;
- mds_mru.Filtered:= False;
- case MRUFilterSender of
- mfsLastName: FilterValue:= Format('(UPPER(ANKLASTNAME) LIKE UPPER(''%%%s%%''))',[UpperCase(Trim(EdtLastName.Text),loUserLocale)]);
- mfsFirstName: FilterValue:= Format('(UPPER(ANKFIRSTNAME) LIKE UPPER(''%%%s%%''))',[UpperCase(Trim(EdtFirstName.Text), loUserLocale)]);
- mfsThirdName: FilterValue:= Format('(UPPER(ANKTHIRDNAME) LIKE UPPER(''%%%s%%''))',[UpperCase(Trim(EdtThirdName.Text), loUserLocale)]);
- end;
- mds_mru.Filter:= FilterValue;
- mds_mru.Filtered:= True;
- if mds_mru.IsEmpty then Exit;
- i:= 0;
- mds_mru.First;
- while (not mds_mru.Eof or (i <= maxCount)) do
- begin
- case MRUFilterSender of
- mfsLastName: MRUList.Add(Trim(mds_mru.FieldByName('ANKLASTNAME').AsString));
- mfsFirstName: MRUList.Add(Trim(mds_mru.FieldByName('ANKFIRSTNAME').AsString));
- mfsThirdName: MRUList.Add(Trim(mds_mru.FieldByName('ANKTHIRDNAME').AsString));
- end;
- Inc(i);
- mds_mru.Next;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement