Screen.Cursor changes the cursor of your application. "Component".Cursor
changes the cursor of one component if Screen.Cursor = crDefault. If
Screen.Cursor <> crDefault you cannot change a component's cursor.
Changing a component's cursor property does not refresh the cursor, it
is refreshed when it is moved. You can simulate this:
Panel1.Cursor := SomeCursor;
Panel1.Parent.Perform (WM_SETCURSOR,Parent.Handle,HTCLIENT);
or (if the first one does not work for some reason)...
Panel1.Cursor := SomeCursor;
Mouse_Event (MOUSEEVENTF_MOVE,1,0,0,0);
Mouse_Event (MOUSEEVENTF_MOVE,-1,0,0,0);
Panel1.Parent.Perform (WM_SETCURSOR,Parent.Handle,HTCLIENT) forces the
cursor shape to
refresh, the second method is just a trick: move the cursor one pixel to
the right and one to the left again, which makes it refresh, too.
Jens
Partager