Autor Beitrag
Crowbar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mo 18.10.04 14:01 
Hi,
die Methode GetItemAt (TListView) gibt das Listenelement an der angegebenen Position zurück.
Gibt es zur GetItemAt eine "alternative" Methode für die TListBox?

Cu Crowbar
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mo 18.10.04 14:08 
guck dir mal ItemAtPos an

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mo 18.10.04 14:33 
Hi GSE,
danke für den Hinweis... :wink: ... so klappt es !

Hier ein Beispiel-Code, sollte jemand ebenfalls vor dieser "Frage" stehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,  Y: Integer);
var
  Info  : TPoint;
  Index : Integer;

begin
  Info :=Point(X,Y);
  Index:=ListBox1.ItemAtPos(Info,true);
  if Index <> -1 then Label1.Caption:=ListBox1.Items[Index]
  else
  Label1.Caption:='';
end;

Cu
Crowbar

Moderiert von user profile iconKlabautermann: Code durch Delphi-Tags ersetzt.