Autor Beitrag
Blacked
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 12.09.02 11:19 
Ich hab folgendes Problem: Ich will das ein Item also ein Verzeichnis Makiert wird wenn ich mit der Maus Darüber bin... quasi ein Mouseover!

Ich hab eine DirectoryListBox und darin würde ich das gerne machen.

Er soll nur den Ordner Makieren bzw. Selectieren wenn ich mit der Maus über ihm bin, mehr nicht!
Und da so eine DirectoryListBox ja mit Items arbeitet müsste das doch irgendwie gehen oder?!

Bin für jede Hilfe dankbar!!

mfg Blacked :roll:

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.
b.brecht
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Do 12.09.02 16:18 
Hallo!

Ich habe Dir mal einen kleinen CODE gemacht (Allerdings mit einer TListBox). Es sollte eiegntlich funktionieren:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure Mark(y,hi,menge:integer; ListBox:TListBox);
var pos:real;
begin
pos:=trunc(y/hi);
if pos>menge then exit;
ListBox.Selected[Round(pos)]:=true;
end;

procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
Mark(Y,Form1.ListBox1.ItemHeight,Form1.ListBox1.Items.Count-1,Form1.ListBox1);
end;
Blacked Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mo 16.09.02 09:37 
Danke, das hat soweit geklappt...
wenn ich es allerdings auf meine DirectoryListbox anwende kann er das makieren nicht umsetzen also das "DirectoryListBox1.Selected[2]:=true;" als beispiel!

Dann bringt er mir die meldung das der Index der Liste überschritten wird... hat da wer ne Idee an was das liegen könnte?!

Danke Blacked :nixweiss:

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mo 16.09.02 10:23 
Hi
Die Eigenschaft Selected lässt sich IMHO nur in Verbindung mit MultiSelect verwenden. Und das gibts bei der DirectoryListBox nicht. Ändere einfach die Procedure Mark ab:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure Mark(y,hi,menge:integer; ListBox:TListBox); 
var pos:real; 
begin 
  pos:=trunc(y/hi); 
  if pos>menge then exit; 
  ListBox.ItemIndex := Round(Pos); 
end;


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Blacked Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mo 16.09.02 10:39 
Danke vielmals, hat geklappt!! :D
*freu*

Gruss Blacked :think:

_________________
Modern programming is a race between the programmer striving to build bigger and better idiotproof programs and the Universe trying to build bigger and better idiots.
So far the Universe is winning.