Einzelnen Beitrag anzeigen

jcop

Registriert seit: 16. Dez 2004
9 Beiträge
 
Delphi 2005 Personal
 
#9

Re: In English (Ini question)

  Alt 27. Dez 2004, 14:48
Hello,

Again a question concerning this method.

[Section.1]
Title= Nissan
colour= Red
engine= 1400cc
Turbo = no

[Section.2]
Title= Renault
colour= Blue
engine = 1800
Turbo= yes

Now I can see the titles inside de combobox, but when I click on 1 of them to view the colour for eg.
my dedicated textbox stays empty.
I was using the following method for this function but then again this was only working when loading the sections into the combobox.
Delphi-Quellcode:
procedure TForm1.cboSectionsChange(Sender: TObject);
begin
  carconfig := Tinifile.Create(opendialog1.FileName);

  with carconfig do
  try
  ReadSections(CboSections.Items);

  txtTitle.Text := Readstring(cboSections.Text, 'Title', '');
  txtColour.Text := ReadString (cboSections.Text, 'Colour', '');
  txtEngine.Text := ReadString (cboSections.Text, 'engine', '');
  txtTurbo.Text := ReadString (cboSections.Text, 'Turbo','');

  Finally
  carconfig.Free;
  end;
end;
I was thinking of porting the button1.openclick event also into the cbosctionschange event but that's resulting in a error.

Hope you can help me this one also, providing me with the right direction to search would also be welcome.
Thanks
  Mit Zitat antworten Zitat