Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#29

Re: Kleine Adress-Datenbank

  Alt 20. Feb 2009, 21:13
Hat sich erledigt, war Blödsinn.

Anzeigen sieht jetzt so aus:
Delphi-Quellcode:
procedure TfrmAdressen.ShowContactDetails;
var
  Details : TDetails;
  Contact : TContact;
begin
  if (lbContacts.ItemIndex > -1) then
  begin
    Details := TDetails.Create(nil);
    try
      Details.Contact := TContact(lbContacts.Items.Objects[lbContacts.ItemIndex]);;
      Details.ShowModal;
      if Details.Modified then
      begin
        ContactCollection.HasBeenModified := True;
        FillListbox;
        UpdateStatusbar;
      end;
    finally
      Details.Release;
    end;
  end;
end;
Undneu sieht so aus:
Delphi-Quellcode:
procedure TfrmAdressen.NewContact;
var
  Details : TDetails;
  Contact : TContact;
begin
  Details := TDetails.Create(nil);
  try
    Details.IsNewContact := True;
    Details.Caption := 'Neuer Kontakt';
    Contact := TContact.Create;
    Details.Contact := Contact;
    Details.ShowModal;
    if Details.Modified then
    begin
      ContactCollection.Add(Contact);
      ContactCollection.HasBeenModified := True;
      FillListbox;
      UpdateStatusbar;
    end;
  finally
    Details.Release;
  end;
end;
Hast du dir das so gedacht?

Aktuelle Version (1.0.0.27 im ersten Posting.

PS: Jetzt sollte es aber klappen. Hmpf.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat