Thema: Delphi ComboBox1.Itemindex

Einzelnen Beitrag anzeigen

horst

Registriert seit: 1. Jul 2003
347 Beiträge
 
Delphi 2007 Professional
 
#1

ComboBox1.Itemindex

  Alt 26. Okt 2003, 22:00
hallo
habe auf form2 ein edit, in dieses edit gebe ich ein wort ein...
alles wird in einer datei gespeichert
mein problem ist eine combobox auf form1, die items werden mit
Delphi-Quellcode:
with ComboBox1 do
begin
  Items.LoadFromFile(extractfilepath(application.exename)+ 'themen\themen.txt');
aus einer textdatei gefüllt.
nun zu meiner frage:
ich möchte, das in form2.edit eingegebene wort in der combobox auf form1 zu sehen ist.
quasi als Form1.ComboBox1.Itemindex

Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
Var
  I : Integer;
  F : TextFile;
  temp:string;
Begin
   memo1.lines.loadfromfile(extractfilepath(application.exename)+ 'themen\themen.txt');
   memo1.lines.add(edit1.text);
   createDir(extractfilepath(application.exename)+ 'themen\'+''+edit1.Text+'');
   memo1.lines.savetofile(extractfilepath(application.exename)+ 'themen\themen.txt');
   memo1.clear;
   close;
   Form1.ComboBox1.Items.LoadFromFile(extractfilepath(application.exename)+ 'themen\themen.thm');
   Form1.ComboBox1.Itemindex:=edit1.Text; // <----das ist mein problem
End;
  Mit Zitat antworten Zitat