0

How can I change the cursor when I'm hovering an ImageIndex from a node

Basically I have an attach icon displayed on a node and i would like to let user understand, by changing the cursor, that he have the possibility to download the file by pressing on it.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
REALSOFO
  • 852
  • 9
  • 37

1 Answers1

1

In the tree's OnMouseMove event check wether the cursor is over the "icon area" and change the cursor accordingly. Something like

procedure TForm1.VTMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var HitInfo: THitInfo;
begin
  VT.GetHitTestInfoAt(X, Y, True, HitInfo);
  if(hiOnNormalIcon in HitInfo.HitPositions)then begin
     VT.Cursor := crHandPoint;
  end else begin
     VT.Cursor := crDefault;
  end;
end;

The VT variable is your TVirtualStringTree object.

ain
  • 22,394
  • 3
  • 54
  • 74