However, when I insert code such as:
Image1.Cursor := crHandPoint;
the desired effect does not occur, even if followed by the
Application.ProcessMessages event. Any help will be greatly appreciated.
{ Save initial cursor }
MyOldCursor :=Application.Cursor;
try
Application.Cursor := crHandPoint;
...
finally
{ Restore the initial cursor}
Application.Cursor :=MyOldCursor;
end;
--
Andrei Fomine.
Add full-blown clipboard and drag-and-drop capabilities to any control with
Transfer@once.
DbAltGrid allows multi-line layout and RTF text in a DBGrid descendant.
http://www.quasidata.com/
"Bruce Baker" <b.a....@xtra.co.nz> wrote in message
news:3b96e01e$1_2@dnews...
On the MouseUp you just set the mouse default again.
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Screen.Cursor := crDefault;
end;
All this only works for left-clicks since Delphi does not capture the mouse
when right-clicking. If you also want this to happen you need to capture the
mouse yourself.
Note that if this is how you plan to change the mouse you should be aware
that OnMouseDown is not always followed by an OnMouseUp event, thus your
cursor migth end up crHandPoint when the mouse is not pressed (e.g. pressing
the mouse then ALT+TAB will result in a Down but not Up).
To resolve this problem you can trap the WM_CAPTURECHANGED message which is
sent when you loose the mouse focus.
Sincerely
Peter Kristensen
Thank you very much for your help!