Page 1 of 1

Modify Cursor

Posted: Wed Oct 08, 2014 3:49 pm
by show00
when i modify Cursor in OnMouseMove,but the Cursor not change
i must call Format() ?

Posted: Wed Oct 08, 2014 3:54 pm
by show00
i can't use GetItemCursor,beacuse i do something in OnPaint,i want use PtInRect to change the cursor

Posted: Thu Oct 09, 2014 2:02 pm
by Sergey Tkachenko
Do you need to change cursor inside or outside items?

Posted: Thu Oct 09, 2014 4:45 pm
by show00
No items,I draw some areas in OnPaint
when the mouse into different areas ,i want change different curosr

OnMouseMove:
TPoint ptCursor;
GetCursorPos(&ptCursor);
ptCursor = ScreenToClient(ptCursor);
if(pRVESystemBar->PtInSystemBar(Handle,ptCursor))//call PtInRect
{

Cursor = crHandPoint;
}
else
{
Cursor = crDefault;
}

but the cursor not change

Posted: Fri Oct 10, 2014 7:16 am
by Sergey Tkachenko
I made a small test:

Code: Select all

procedure TForm3.RichViewEdit1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if X<20 then
    RichViewEdit1.Cursor := crHelp
  else
    RichViewEdit1.Cursor := crIBeam;
end;
The cursor is changed as expected, when the mouse is close to the left border.

Posted: Fri Oct 10, 2014 11:21 am
by show00
my class InheritsFrom TRichViewEdit,i overwrite the OnMouseMove...