Autor Beitrag
der_zaehe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

WinXP SP2
D6 Pers, D2005 Prof, VS2005
BeitragVerfasst: Mo 28.03.05 20:40 
Wie der Titel schon sagt:

Ich stehe vor dem problem, einträge in einem baum per rechtsklick anzuwählen. die eigenschaft RightKlickSelect habe ich schon auf TRUE gesetzt, ich kann auch ein element "teilweise" auswählen, aber:
- nur solange die recht maustaste gedrückt ist.
- der entsprechende eintrag wird nur farbig hinterlegt, der "gestrichelte kasten um den eintrag" (ich hoffe, ihr wisst, was ich damit meine)- und somit die auswahl - bleibt da wo sie ist und rührt sich nicht von der stelle.

schon mal danke für eure hilfe

_________________
[inspirationslos]
Holgerwa
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 325

WIN XP Pro, Vista Business
Delphi 7 Pro, BDS 2006 Pro
BeitragVerfasst: Mo 28.03.05 21:43 
Hallo,

Ich würde das Ereignis OnContextPopup verwenden, und zwar so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.TreeView1.ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
var tn: TTreeNode;
begin
  tn := TTreeView (Sender).GetNodeAt (MousePos.X, MousePos.Y); // Node am Mauszeiger, oder nil
  if tn <> nil then
    TTreeView (Sender).Selected := tn; // Node unter Mauszeiger selektieren
end;

Holger
der_zaehe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

WinXP SP2
D6 Pers, D2005 Prof, VS2005
BeitragVerfasst: Mo 28.03.05 21:59 
genau das wars!

vielen dank noch mal!

_________________
[inspirationslos]