AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Editfeld mit Dropdownmenü

Ein Thema von KahPee · begonnen am 24. Dez 2009 · letzter Beitrag vom 25. Dez 2009
 
Benutzerbild von KahPee
KahPee

Registriert seit: 12. Mai 2009
214 Beiträge
 
Turbo Delphi für Win32
 
#18

Re: Editfeld mit Dropdownmenü

  Alt 25. Dez 2009, 00:24
Delphi-Quellcode:
procedure Tform2.Autocomplete(Combobox: TCombobox);
var
  EntryNum, selstart, sellength: Integer;
  EntryValue: string;
  statistic: TiniFile;
  i: Integer;
begin
  statistic := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'statistic.ini');
  try

    EntryNum := statistic.ReadInteger('Playerlist', 'count', 0);

    selstart := ComboBox.SelStart;
    sellength := ComboBox.SelLength;
    Combobox.Items.Clear;
    Combobox.Items.BeginUpdate;
    for i := 1 to EntryNum do
    begin
      EntryValue := statistic.ReadString('Playerlist', IntToStr(i), '');

      if (combobox.Text='') or((EntryValue <> '') and (Pos(LowerCase(Combobox.Text), LowerCase(EntryValue)) = 1)) then
      begin
       Combobox.Items.Add(EntryValue);
      end;
    end;

    Combobox.Items.EndUpdate;
    ComboBox.SelStart := selstart;
    ComboBox.SelLength := sellength;

  finally
    FreeAndNil(statistic);
  end;
end;
Damit klappts

Vielen Dank
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz