Showing posts with label mouse. Show all posts
Showing posts with label mouse. Show all posts

Question:
How to Confine The Mouse?

Answer:
procedure TForm1.Button1Click(Sender: TObject);
var
Rect: TRect;
begin
Rect.Left := Left;
Rect.Top := Top;
Rect.Right := Left + Width;
Rect.Bottom := Top + Height;
ClipCursor(@Rect);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ClipCursor(nil);
end;




Question:
How to hide mouse cursor?

Answer:
Simple.
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowCursor(False); // Hide cursor
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
ShowCursor(True); // Show cursor
end;


CLICK TO REGISTER