Autor Beitrag
sTk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70

Win 2000, Win XP
Turbo Delphi Pro, D2005 PE, Lazarus
BeitragVerfasst: Di 17.01.06 09:08 
Hi,

ich habe ein wahrscheinlich banales Problem, aber ich komme einfach nicht drauf.

Wie kann ich prüfen, ob die Zeile eines ListView, das ich gerade angeklickt habe leer ist oder nicht.

ListView1.Selected.???

Ich komme hier nicht weiter! Wer kann mir helfen?

Gruß, Steffen
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10184
Erhaltene Danke: 1259

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 17.01.06 10:29 
Moin!

WIe definierst du denn "leer"? :gruebel:

cu
Narses
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 17.01.06 10:35 
Entweder
ausblenden Delphi-Quelltext
1:
2:
if not assigned (ListView1.Selected) then
  ;


oder
ausblenden Delphi-Quelltext
1:
2:
if ListView1.Selected.Caption = '' then
  ;


Lg Martin

_________________
Ein Nutzer der Ecke ;-)
sTk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70

Win 2000, Win XP
Turbo Delphi Pro, D2005 PE, Lazarus
BeitragVerfasst: Di 17.01.06 10:47 
Die Frage war vielleicht etwas schlecht gestellt.

Mein Problem ist folgendes.

Ich reagiere bei einer ListView auf das OnClick-Ereignis.
Ich schreibe dann in die ausgewählte Zeile.

ausblenden Delphi-Quelltext
1:
ListView1.Selected.SubItems[0] := 'MeinText'					


Jetzt ist es aber so, wenn ich auf einen leeren Bereich(also Zeilen ohne jeglichen Eintrag) klicke, dann kommt eine Fehlermeldung!

Ich muß also irgendwie prüfen, ob in der Zeil, die das OnClick-Ereignis ausgelöst hat ein Eintrag steht oder nicht.

Gruß, Steffen
sTk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70

Win 2000, Win XP
Turbo Delphi Pro, D2005 PE, Lazarus
BeitragVerfasst: Di 17.01.06 10:50 
@Martin1966

assigned() war die Lösung!!!
Top, vielen Dank!

Gruß, Steffen
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 17.01.06 10:53 
user profile iconsTk hat folgendes geschrieben:
Top, vielen Dank!

Bitte! ;-)

Noch ein kleiner Tipp: markiere Deine Frage als Erledigt damit die Leser wissen, dass Deine Frage beantwortet wurde. ;-)

Lg Martin

_________________
Ein Nutzer der Ecke ;-)