Autor Beitrag
moloch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mo 16.08.04 07:59 
Hallo Leute,
ich habe mir eine Tabellenansicht mit Listview erstellt.
Jetzt möchte ich diese wieder schliessen um eine andere zu öffnen.
Wie mache ich das?Gibt es vielleicht eine funktion?

MFG
moloch
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 16.08.04 08:06 
Hallo!

Was meinst du mit schließen?

Wenn du die Einträge in der Listview löschen willst musst du die Delete Methode von der Eigenschaft Items aufrufen:
ausblenden Delphi-Quelltext
1:
ListView1.Items.Delete;					

Gruß
Tino
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mo 16.08.04 08:23 
hallo,
naja ich mache als erstes

ListView := TListView.Create(Self);
....


jetzt ist alles aufgebaut.
So und jetzt möchte ich das diese Liste verschwindet so dass ich wieder mit

ListView := TListView.Create(Self) anfangen kann.

Dazu gehört natürlich noch die frage ob die Liste schon besteht. WEnn Du das auch weisst wäre das super.
Also die nil-abfrage hat mich da nicht weitergebracht.

MFG

moloch
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 16.08.04 08:37 
ausblenden Delphi-Quelltext
1:
ListView.Free;					
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mo 16.08.04 09:31 
Also das hatte ich schon.
Ich muss doch auch die Spalten und Zeilenobjekte frei geben damit das alles weg ist oder?
mfg
moloch
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Di 17.08.04 11:24 
Also ich möchte die ListView wirklich schliessen um eine neue zu öffnen.
Wie kriege ich raus ob schon eine listview offen ist im Projekt und wie schliesse ich das ding?

mfg
moloch
espen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 90
Erhaltene Danke: 1


D6 Prof./D7 Prof. MSSQL, MySQL
BeitragVerfasst: Di 17.08.04 11:59 
So vielleicht ?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
// ****
// **** ListView suchen
// ****
ListView := FindComponent('lstView') as TListView;
if ListView <> nil then
begin
  // ****
  // **** Gefunden und weg damit
  // ****
  FreeAndNil(ListView);
end;
// ****
// **** Neue Listview erstellen (und benennen)
// ****
ListView      := TListView.Create(Self);
ListView.Name := 'lstView';
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Di 17.08.04 12:27 
hey espen,
danke für den tip.ich werde es gleich ausprobieren und bescheid sagen.
mfg
moloch
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Di 17.08.04 13:37 
hey espen,
danke für deine hilfe.es klappt.
mfg
moloch