Board index » delphi » Problem with RightClickSelect on the TTreeView

Problem with RightClickSelect on the TTreeView


2003-09-19 10:27:14 PM
delphi174
I am using Delphi 7 Ent. I set my RightClickSelect = True on my TTreeView.
When I Right click on a TreeNode, the node is Highlighted but not selected.
After you let go on the Right Mouse button, the node (that you right clicked
on) is not Highlighted any more and the node that was originally Highlighted
is Highlighted again. Am I doing something wrong?
 
 

Re:Problem with RightClickSelect on the TTreeView

Unfortunatelly same behaviour is from Delphi 3 without any fix:-(
Instead play with RightClickSelect, better to use the next code in
OnMouseDown event:
procedure TForm1.TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
node: TTreeNode;
begin
if (Button = mbRight) then
begin
node := TreeView1.GetNodeAt(X, Y);
if Assigned(node) then
node.Selected := True
end
end;
"Shayler Rychlick" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях
следующе? news:3f6b10a7$XXXX@XXXXX.COM...
Quote
I am using Delphi 7 Ent. I set my RightClickSelect = True on my
TTreeView.
When I Right click on a TreeNode, the node is Highlighted but not
selected.
After you let go on the Right Mouse button, the node (that you right
clicked
on) is not Highlighted any more and the node that was originally
Highlighted
is Highlighted again. Am I doing something wrong?